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

LearnLib / learnlib / 6433387082

06 Oct 2023 03:10PM UTC coverage: 92.296% (-0.007%) from 92.303%
6433387082

push

github

mtf90
update Falk's developer id

11573 of 12539 relevant lines covered (92.3%)

1.67 hits per line

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

72.22
/algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/adt/ADTResetNode.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of LearnLib, http://www.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.algorithms.adt.adt;
17

18
import java.util.Collections;
19
import java.util.Map;
20

21
import de.learnlib.api.oracle.SymbolQueryOracle;
22
import net.automatalib.words.Word;
23
import org.checkerframework.checker.nullness.qual.Nullable;
24

25
/**
26
 * Reset node implementation.
27
 *
28
 * @param <S>
29
 *         (hypothesis) state type
30
 * @param <I>
31
 *         input alphabet type
32
 * @param <O>
33
 *         output alphabet type
34
 */
35
public class ADTResetNode<S, I, O> implements ADTNode<S, I, O> {
36

37
    private final ADTNode<S, I, O> successor;
38
    private ADTNode<S, I, O> parent;
39

40
    public ADTResetNode(ADTNode<S, I, O> successor) {
2✔
41
        this.successor = successor;
2✔
42
    }
2✔
43

44
    @Override
45
    public @Nullable I getSymbol() {
46
        return null;
×
47
    }
48

49
    @Override
50
    public void setSymbol(I symbol) {
51
        throw new UnsupportedOperationException("Reset nodes do not have a symbol");
×
52
    }
53

54
    @Override
55
    public ADTNode<S, I, O> getParent() {
56
        return this.parent;
2✔
57
    }
58

59
    @Override
60
    public void setParent(ADTNode<S, I, O> parent) {
61
        this.parent = parent;
2✔
62
    }
2✔
63

64
    @Override
65
    public Map<O, ADTNode<S, I, O>> getChildren() {
66
        return Collections.singletonMap(null, this.successor);
2✔
67
    }
68

69
    @Override
70
    public @Nullable S getHypothesisState() {
71
        return null;
×
72
    }
73

74
    @Override
75
    public void setHypothesisState(S state) {
76
        throw new UnsupportedOperationException("Reset nodes cannot reference a hypothesis state");
×
77
    }
78

79
    @Override
80
    public ADTNode<S, I, O> sift(SymbolQueryOracle<I, O> oracle, Word<I> prefix) {
81
        oracle.reset();
2✔
82

83
        for (I i : prefix) {
2✔
84
            oracle.query(i);
2✔
85
        }
2✔
86

87
        return successor;
2✔
88
    }
89

90
    @Override
91
    public NodeType getNodeType() {
92
        return NodeType.RESET_NODE;
2✔
93
    }
94

95
    @Override
96
    public String toString() {
97
        return "reset";
×
98
    }
99
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc