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

LearnLib / automatalib / 6673214172

27 Oct 2023 11:30PM UTC coverage: 89.166% (-0.6%) from 89.796%
6673214172

push

github

mtf90
cleanup release configuration

15399 of 17270 relevant lines covered (89.17%)

1.67 hits per line

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

56.25
/core/src/main/java/net/automatalib/graph/ads/impl/AbstractRecursiveADSLeafNode.java
1
/* Copyright (C) 2013-2023 TU Dortmund
2
 * This file is part of AutomataLib, http://www.automatalib.net/.
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 net.automatalib.graph.ads.impl;
17

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

21
import net.automatalib.graph.ads.RecursiveADSNode;
22
import org.checkerframework.checker.nullness.qual.Nullable;
23

24
/**
25
 * An abstract implementation of a leaf node, that may be used by other ADS-extending classes.
26
 *
27
 * @param <S>
28
 *         (hypothesis) state type
29
 * @param <I>
30
 *         input alphabet type
31
 * @param <O>
32
 *         output alphabet type
33
 * @param <N>
34
 *         the concrete node type
35
 */
36
public abstract class AbstractRecursiveADSLeafNode<S, I, O, N extends RecursiveADSNode<S, I, O, N>>
37
        implements RecursiveADSNode<S, I, O, N> {
38

39
    private @Nullable N parent;
40
    private S hypothesisState;
41

42
    public AbstractRecursiveADSLeafNode(@Nullable N parent, S hypothesisState) {
1✔
43
        this.parent = parent;
1✔
44
        this.hypothesisState = hypothesisState;
1✔
45
    }
1✔
46

47
    @Override
48
    public @Nullable I getSymbol() {
49
        return null;
×
50
    }
51

52
    @Override
53
    public void setSymbol(I symbol) {
54
        throw new UnsupportedOperationException("Cannot set symbol state on a leaf node");
×
55
    }
56

57
    @Override
58
    public @Nullable N getParent() {
59
        return this.parent;
1✔
60
    }
61

62
    @Override
63
    public void setParent(@Nullable N parent) {
64
        this.parent = parent;
1✔
65
    }
1✔
66

67
    @Override
68
    public Map<O, N> getChildren() {
69
        return Collections.emptyMap();
×
70
    }
71

72
    @Override
73
    public boolean isLeaf() {
74
        return true;
1✔
75
    }
76

77
    @Override
78
    public S getHypothesisState() {
79
        return this.hypothesisState;
1✔
80
    }
81

82
    @Override
83
    public void setHypothesisState(S state) {
84
        this.hypothesisState = state;
×
85
    }
×
86

87
    @Override
88
    public String toString() {
89
        final S state = this.getHypothesisState();
×
90
        return state == null ? "<null>" : state.toString();
×
91
    }
92
}
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