Interface ITcDataSource<V>
- Type Parameters:
V
- the type parameter of the node
- All Known Implementing Classes:
CountingAlg
,DRedAlg
,IncSCCAlg
public interface ITcDataSource<V>
This interface defines those methods that a transitive reachability data source should provide.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getAllReachableSources
(V target) Returns all nodes from which the target node is reachable.getAllReachableTargets
(V source) Returns all nodes which are reachable from the source node.The returnedIGraphPathFinder
can be used to retrieve paths between nodes using transitive reachability.boolean
isReachable
(V source, V target) Returns true if the target node is reachable from the source node.
-
Method Details
-
attachObserver
Attach a transitive closure relation observer.- Parameters:
to
- the observer object
-
detachObserver
Detach a transitive closure relation observer.- Parameters:
to
- the observer object
-
getAllReachableTargets
Returns all nodes which are reachable from the source node.- Parameters:
source
- the source node- Returns:
- the set of target nodes
-
getAllReachableSources
Returns all nodes from which the target node is reachable.- Parameters:
target
- the target node- Returns:
- the set of source nodes
-
isReachable
Returns true if the target node is reachable from the source node.- Parameters:
source
- the source nodetarget
- the target node- Returns:
- true if target is reachable from source, false otherwise
-
getPathFinder
IGraphPathFinder<V> getPathFinder()The returnedIGraphPathFinder
can be used to retrieve paths between nodes using transitive reachability.- Returns:
- a path finder for the graph.
-
dispose
void dispose()Call this method to properly dispose the data structures of a transitive closure algorithm.
-