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

LearnLib / automatalib / 6606273079

22 Oct 2023 09:15PM UTC coverage: 89.282% (+0.02%) from 89.262%
6606273079

push

github

mtf90
s/fromCharSequence/fromString/g

10 of 10 new or added lines in 2 files covered. (100.0%)

15328 of 17168 relevant lines covered (89.28%)

1.65 hits per line

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

92.86
/api/src/main/java/net/automatalib/automaton/graph/AutomatonGraphView.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.automaton.graph;
17

18
import java.util.ArrayList;
19
import java.util.Collection;
20
import java.util.List;
21

22
import net.automatalib.automaton.Automaton;
23
import net.automatalib.automaton.visualization.AutomatonVisualizationHelper;
24
import net.automatalib.visualization.VisualizationHelper;
25

26
public class AutomatonGraphView<S, I, T, A extends Automaton<S, I, T>>
27
        extends AbstractAutomatonGraphView<S, A, TransitionEdge<I, T>> {
28

29
    protected final Collection<? extends I> inputs;
30

31
    public AutomatonGraphView(A automaton, Collection<? extends I> inputs) {
32
        super(automaton);
1✔
33
        this.inputs = inputs;
1✔
34
    }
1✔
35

36
    @Override
37
    public Collection<TransitionEdge<I, T>> getOutgoingEdges(S node) {
38
        return createTransitionEdges(automaton, inputs, node);
1✔
39
    }
40

41
    public static <S, I, T> Collection<TransitionEdge<I, T>> createTransitionEdges(Automaton<S, I, T> automaton,
42
                                                                                   Collection<? extends I> inputs,
43
                                                                                   S state) {
44
        List<TransitionEdge<I, T>> result = new ArrayList<>();
1✔
45

46
        for (I input : inputs) {
1✔
47
            Collection<T> transitions = automaton.getTransitions(state, input);
1✔
48
            for (T t : transitions) {
1✔
49
                result.add(new TransitionEdge<>(input, t));
1✔
50
            }
1✔
51
        }
1✔
52

53
        return result;
1✔
54
    }
55

56
    @Override
57
    public S getTarget(TransitionEdge<I, T> edge) {
58
        return automaton.getSuccessor(edge.getTransition());
1✔
59
    }
60

61
    @Override
62
    public VisualizationHelper<S, TransitionEdge<I, T>> getVisualizationHelper() {
63
        return new AutomatonVisualizationHelper<>(automaton);
×
64
    }
65
}
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