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

LearnLib / automatalib / 6668764019

27 Oct 2023 02:48PM UTC coverage: 89.69% (+0.007%) from 89.683%
6668764019

push

github

mtf90
cleanup (Idefinite)Graph interfaces

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

15832 of 17652 relevant lines covered (89.69%)

1.66 hits per line

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

33.33
/api/src/main/java/net/automatalib/graph/IndefiniteGraph.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.Iterator;
19
import java.util.Objects;
20

21
import com.google.common.collect.Iterators;
22

23
/**
24
 * Interface for an (indefinite) graph structure. A graph consists of nodes, each of which has outgoing edges connecting
25
 * to other nodes. In an indefinite graph, the node set is not required to be finite.
26
 *
27
 * @param <N>
28
 *         node type
29
 * @param <E>
30
 *         edge type
31
 */
32
public interface IndefiniteGraph<N, E> extends IndefiniteSimpleGraph<N> {
33

34
    Iterator<E> getOutgoingEdgesIterator(N node);
35

36
    @Override
37
    default Iterator<N> getAdjacentTargetsIterator(N node) {
38
        return Iterators.transform(getOutgoingEdgesIterator(node), this::getTarget);
×
39
    }
40

41
    @Override
42
    default IndefiniteGraph<N, E> asNormalGraph() {
43
        return this;
×
44
    }
45

46
    default Iterator<E> getEdgesBetween(N from, N to) {
47
        return Iterators.filter(getOutgoingEdgesIterator(from), e -> Objects.equals(getTarget(e), to));
1✔
48
    }
49

50
    /**
51
     * Retrieves, for a given edge, its target node.
52
     *
53
     * @param edge
54
     *         the edge.
55
     *
56
     * @return the target node of the given edge.
57
     */
58
    N getTarget(E edge);
59

60
}
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