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

LearnLib / learnlib / 29811515977

21 Jul 2026 07:42AM UTC coverage: 95.325% (-2.1%) from 97.453%
29811515977

push

github

mtf90
examples: remove redundant SupressWarnings

14907 of 15638 relevant lines covered (95.33%)

1.74 hits per line

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

94.59
/algorithms/active/ttt/src/main/java/de/learnlib/algorithm/ttt/base/TTTTransition.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 de.learnlib.AccessSequenceProvider;
19
import de.learnlib.datastructure.list.AbstractIntrusiveListEntryImpl;
20
import net.automatalib.word.Word;
21
import net.automatalib.word.WordBuilder;
22
import org.checkerframework.checker.nullness.qual.Nullable;
23

24
/**
25
 * A transition in a {@link AbstractTTTHypothesis}.
26
 *
27
 * @param <I>
28
 *         input symbol type
29
 */
30
public class TTTTransition<I, D> extends AbstractIntrusiveListEntryImpl<TTTTransition<I, D>>
2✔
31
        implements AccessSequenceProvider<I> {
32

33
    private final TTTState<I, D> source;
34
    private final I input;
35
    // NON-TREE TRANSITION
36
    AbstractBaseDTNode<I, D> nonTreeTarget;
37
    // TREE TRANSITION
38
    private TTTState<I, D> treeTarget;
39

40
    public TTTTransition(TTTState<I, D> source, I input) {
2✔
41
        this.source = source;
2✔
42
        this.input = input;
2✔
43
    }
2✔
44

45
    public TTTState<I, D> getTreeTarget() {
46
        assert isTree();
2✔
47

48
        return treeTarget;
2✔
49
    }
50

51
    public boolean isTree() {
52
        return treeTarget != null;
2✔
53
    }
54

55
    public AbstractBaseDTNode<I, D> getNonTreeTarget() {
56
        assert !isTree();
2✔
57

58
        return nonTreeTarget;
2✔
59
    }
60

61
    void setNonTreeTarget(AbstractBaseDTNode<I, D> nonTreeTarget) {
62
        this.nonTreeTarget = nonTreeTarget;
2✔
63
        nonTreeTarget.getIncoming().add(this);
2✔
64
    }
2✔
65

66
    public AbstractBaseDTNode<I, D> getDTTarget() {
67
        if (treeTarget != null) {
2✔
68
            return treeTarget.dtLeaf;
2✔
69
        }
70
        return nonTreeTarget;
2✔
71
    }
72

73
    public TTTState<I, D> getTarget() {
74
        if (treeTarget != null) {
2✔
75
            return treeTarget;
2✔
76
        }
77

78
        assert nonTreeTarget.isLeaf() :
2✔
79
                "transition target is not a leaf, but is a " + (nonTreeTarget.isTemp() ? "temp" : "non-temp") +
×
80
                " node with discriminator: " + nonTreeTarget.getDiscriminator();
×
81
        assert nonTreeTarget.getData() != null;
2✔
82
        return nonTreeTarget.getData();
2✔
83
    }
84

85
    public TTTState<I, D> getSource() {
86
        return source;
2✔
87
    }
88

89
    public I getInput() {
90
        return input;
2✔
91
    }
92

93
    protected @Nullable Object getProperty() {
94
        return null;
2✔
95
    }
96

97
    @Override
98
    public Word<I> getAccessSequence() {
99
        WordBuilder<I> wb = new WordBuilder<>(); // FIXME capacity hint
2✔
100

101
        TTTTransition<I, D> curr = this;
2✔
102

103
        while (curr != null) {
2✔
104
            wb.add(curr.input);
2✔
105
            curr = curr.source.getParentTransition();
2✔
106
        }
107

108
        return wb.reverse().toWord();
2✔
109
    }
110

111
    void makeTree(TTTState<I, D> treeTarget) {
112
        removeFromList();
2✔
113
        this.treeTarget = treeTarget;
2✔
114
        this.nonTreeTarget = null;
2✔
115
    }
2✔
116

117
    @Override
118
    public TTTTransition<I, D> getElement() {
119
        return this;
2✔
120
    }
121
}
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