Package org.eclipse.viatra.query.runtime.base.itc.igraph

## Interface ITcDataSource<V>

- Type Parameters:
    `V` - the type parameter of the node
  All Known Subinterfaces:
    `TransitiveClosureHelper`
  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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | 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.
    `boolean` | `isReachable​(V source, V target)` | Returns true if the target node is reachable from the source node.

- - ### Method Detail

    - #### attachObserver

          void attachObserver​(ITcObserver<V> to)

      Attach a transitive closure relation observer.
      Parameters:
        `to` - the observer object

    - #### detachObserver

          void detachObserver​(ITcObserver<V> to)

      Detach a transitive closure relation observer.
      Parameters:
        `to` - the observer object

    - #### getAllReachableTargets

          java.util.Set<V> getAllReachableTargets​(V source)

      Returns all nodes which are reachable from the source node.
      Parameters:
        `source` - the source node
      Returns:
        the set of target nodes

    - #### getAllReachableSources

          java.util.Set<V> getAllReachableSources​(V target)

      Returns all nodes from which the target node is reachable.
      Parameters:
        `target` - the target node
      Returns:
        the set of source nodes

    - #### isReachable

          boolean isReachable​(V source,
                              V target)

      Returns true if the target node is reachable from the source node.
      Parameters:
        `source` - the source node
        `target` - the target node
      Returns:
        true if target is reachable from source, false otherwise

    - #### getPathFinder

          IGraphPathFinder<V> getPathFinder()

      The returned `IGraphPathFinder` 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.