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

LearnLib / automatalib / 6672550055

27 Oct 2023 09:48PM UTC coverage: 89.796% (+0.1%) from 89.69%
6672550055

push

github

mtf90
bump ADDLib version

15832 of 17631 relevant lines covered (89.8%)

1.66 hits per line

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

75.0
/api/src/main/java/net/automatalib/graph/SimpleGraph.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;
17

18
import java.util.Collection;
19
import java.util.Iterator;
20

21
import com.google.common.collect.Iterators;
22
import net.automatalib.automaton.concept.FiniteRepresentation;
23
import net.automatalib.graph.concept.NodeIDs;
24
import net.automatalib.graph.helper.SimpleNodeIDs;
25
import net.automatalib.visualization.DefaultVisualizationHelper;
26
import net.automatalib.visualization.VisualizationHelper;
27

28
/**
29
 * The finite version of a {@link IndefiniteSimpleGraph}.
30
 *
31
 * @param <N>
32
 *         node type
33
 */
34
public interface SimpleGraph<N> extends IndefiniteSimpleGraph<N>, FiniteRepresentation {
35

36
    /**
37
     * Retrieves an (unmodifiable) collection of the nodes in this graph.
38
     *
39
     * @return the nodes in this graph
40
     */
41
    Collection<N> getNodes();
42

43
    default NodeIDs<N> nodeIDs() {
44
        return new SimpleNodeIDs<>(this);
1✔
45
    }
46

47
    /**
48
     * Returns the {@link VisualizationHelper} that contains information for displaying this graph.
49
     *
50
     * @return the visualization helper
51
     */
52
    default VisualizationHelper<N, ?> getVisualizationHelper() {
53
        return new DefaultVisualizationHelper<>();
×
54
    }
55

56
    @Override
57
    default Iterator<N> iterator() {
58
        return Iterators.unmodifiableIterator(getNodes().iterator());
1✔
59
    }
60

61
    @Override
62
    default int size() {
63
        return getNodes().size();
1✔
64
    }
65

66
    /**
67
     * Basic interface for integer abstractions of graphs. In an integer abstraction, each node of a graph is identified
68
     * with an integer in the range {@code [0, size() - 1]}.
69
     */
70
    interface IntAbstraction extends FiniteRepresentation {
71

72
        boolean isConnected(int source, int target);
73
    }
74
}
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