V - the type parameter of the nodepublic interface ITcDataSource<V>
| Modifier and Type | Method and Description |
|---|---|
void |
attachObserver(ITcObserver<V> to)
Attach a transitive closure relation observer.
|
void |
detachObserver(ITcObserver<V> to)
Detach a transitive closure relation observer.
|
void |
dispose()
Call this method to properly dispose the data structures of a transitive closure algorithm.
|
java.util.Set<V> |
getAllReachableSources(V target)
Returns all nodes from which the target node is reachable.
|
java.util.Set<V> |
getAllReachableTargets(V source)
Returns all nodes which are reachable from the source node.
|
IGraphPathFinder<V> |
getPathFinder()
The returned
IGraphPathFinder can be used to retrieve paths between nodes using transitive reachability. |
java.util.List<V> |
getReachabilityPath(V source,
V target)
Deprecated.
Use
getPathFinder() instead |
boolean |
isReachable(V source,
V target)
Returns true if the target node is reachable from the source node.
|
void attachObserver(ITcObserver<V> to)
to - the observer objectvoid detachObserver(ITcObserver<V> to)
to - the observer objectjava.util.Set<V> getAllReachableTargets(V source)
source - the source nodejava.util.Set<V> getAllReachableSources(V target)
target - the target nodeboolean isReachable(V source, V target)
source - the source nodetarget - the target node@Deprecated java.util.List<V> getReachabilityPath(V source, V target)
getPathFinder() insteadList contains the nodes along the path
(this means that there is an edge in the graph between two consecutive nodes), including the source and target nodes.
A self loop (one edge) is indicated with the source node being present two times in the returned List.
Note that the paths are not maintained incrementally and in worst case the complexity of the path construction is O(|V|+|E|)
(one depth-first graph traversal). There is no guarantee that the given path is the shortest one between the given two nodes.source - the source nodetarget - the target nodeIGraphPathFinder<V> getPathFinder()
IGraphPathFinder can be used to retrieve paths between nodes using transitive reachability.void dispose()