• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LearnLib / learnlib / 31619759710

12 Aug 2026 04:27PM UTC coverage: 95.488% (+1.1%) from 94.368%
31619759710

push

github

mtf90
use new version scheme

15533 of 16267 relevant lines covered (95.49%)

1.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/AbstractBaseDTNode.java
1
/* Copyright (C) 2013-2026 TU Dortmund University
2
 * This file is part of LearnLib <https://learnlib.de>.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package de.learnlib.algorithm.ttt.base;
17

18
import java.util.Iterator;
19

20
import de.learnlib.datastructure.discriminationtree.iterators.DiscriminationTreeIterators;
21
import de.learnlib.datastructure.discriminationtree.model.AbstractTemporaryIntrusiveDTNode;
22
import de.learnlib.datastructure.list.IntrusiveList;
23
import net.automatalib.word.Word;
24

25
public abstract class AbstractBaseDTNode<I, D>
26
        extends AbstractTemporaryIntrusiveDTNode<Word<I>, D, TTTState<I, D>, IntrusiveList<TTTTransition<I, D>>, AbstractBaseDTNode<I, D>> {
27

28
    private final IntrusiveList<TTTTransition<I, D>> incoming = new IntrusiveList<>();
2✔
29

30
    public AbstractBaseDTNode() {
31
        this(null, null);
×
32
    }
×
33

34
    public AbstractBaseDTNode(AbstractBaseDTNode<I, D> parent, D parentEdgeLabel) {
35
        super(parent, parentEdgeLabel, null);
2✔
36
    }
2✔
37

38
    public TTTState<I, D> anySubtreeState() {
39
        AbstractBaseDTNode<I, D> curr = this;
2✔
40
        while (!curr.isLeaf()) {
2✔
41
            curr = curr.anyChild();
2✔
42
        }
43
        return curr.data;
2✔
44
    }
45

46
    public Iterable<TTTState<I, D>> subtreeStates() {
47
        return this::subtreeStatesIterator;
2✔
48
    }
49

50
    public Iterator<TTTState<I, D>> subtreeStatesIterator() {
51
        return DiscriminationTreeIterators.transformingLeafIterator(this, AbstractBaseDTNode::getData);
2✔
52
    }
53

54
    public IntrusiveList<TTTTransition<I, D>> getIncoming() {
55
        return incoming;
2✔
56
    }
57

58
    public Iterator<AbstractBaseDTNode<I, D>> subtreeNodesIterator() {
59
        return DiscriminationTreeIterators.nodeIterator(this);
2✔
60
    }
61

62
    /**
63
     * Updates the {@link TTTTransition#nonTreeTarget} attribute to point to this node for all transitions in the
64
     * incoming list.
65
     */
66
    void updateIncoming() {
67
        for (TTTTransition<I, D> trans : incoming) {
2✔
68
            trans.nonTreeTarget = this;
2✔
69
        }
2✔
70
    }
2✔
71

72
    @Override
73
    public AbstractBaseDTNode<I, D> getElement() {
74
        return this;
2✔
75
    }
76
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc