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

## Interface IGraphDataSource<V>

- Type Parameters:
    `V` - the type of the nodes in the graph
  All Superinterfaces:
    java.io.Serializable
  All Known Subinterfaces:
    IBiDirectionalGraphDataSource<V>
  All Known Implementing Classes:
    Graph, IBiDirectionalWrapper

      public interface IGraphDataSource<V>
      extends java.io.Serializable

  The interface prescribes the set of operations that a graph data source must support.

  Note that the old version of the interface is broken at version 1.6; MultiSets are now presented as Maps instead of Lists.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `attachAsFirstObserver(IGraphObserver<V> observer)` Attaches a new graph observer to this graph data source as the first one.
    `void` | `attachObserver(IGraphObserver<V> observer)` Attaches a new graph observer to this graph data source.
    `void` | `detachObserver(IGraphObserver<V> observer)` Detaches an already registered graph observer from this graph data source.
    `java.util.Set<V>` | `getAllNodes()` Returns the complete set of nodes in the graph data source.
    `java.util.Map<V,java.lang.Integer>` | `getTargetNodes(V source)` Returns the target nodes for the given source node.

- - ### Method Detail

    - #### attachObserver

          void attachObserver(IGraphObserver<V> observer)

      Attaches a new graph observer to this graph data source. Observers will be notified in the order they have been registered.
      Parameters:
        `observer` - the graph observer

    - #### attachAsFirstObserver

          void attachAsFirstObserver(IGraphObserver<V> observer)

      Attaches a new graph observer to this graph data source as the first one. In the notification order this observer will be the first one as long as another call to this method happens.
      Parameters:
        `observer` - the graph observer
      Since:
        1.6

    - #### detachObserver

          void detachObserver(IGraphObserver<V> observer)

      Detaches an already registered graph observer from this graph data source.
      Parameters:
        `observer` - the graph observer

    - #### getAllNodes

          java.util.Set<V> getAllNodes()

      Returns the complete set of nodes in the graph data source.
      Returns:
        the set of all nodes

    - #### getTargetNodes

          java.util.Map<V,java.lang.Integer> getTargetNodes(V source)

      Returns the target nodes for the given source node. The returned data structure is a map (essentially a MultiSet) because of potential parallel edges in the graph data source. The values in the returned map represent the count of the given (source, target) edge. The method must not return null.
      Parameters:
        `source` - the source node
      Returns:
        the target nodes with their count values
      Since:
        1.6