Class IBiDirectionalWrapper<V>
java.lang.Object
tools.refinery.interpreter.rete.itc.igraph.IBiDirectionalWrapper<V>
- Type Parameters:
V- the type parameter of the nodes in the graph data source
- All Implemented Interfaces:
IBiDirectionalGraphDataSource<V>,IGraphDataSource<V>,IGraphObserver<V>
public class IBiDirectionalWrapper<V>
extends Object
implements IBiDirectionalGraphDataSource<V>, IGraphObserver<V>
This class can be used to wrap an
IGraphDataSource into an IBiDirectionalGraphDataSource. This class
provides support for the retrieval of source nodes for a given target which is not supported by standard
IGraphDataSource implementations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachAsFirstObserver(IGraphObserver<V> observer) Attaches a new graph observer to this graph data source as the first one.voidattachObserver(IGraphObserver<V> observer) Attaches a new graph observer to this graph data source.voiddetachObserver(IGraphObserver<V> observer) Detaches an already registered graph observer from this graph data source.voidedgeDeleted(V source, V target) Used to notify when an edge is deleted from the graph.voidedgeInserted(V source, V target) Used to notify when an edge is inserted into the graph.Returns the complete set of nodes in the graph data source.getSourceNodes(V target) Returns the source nodes for the given target node.getTargetNodes(V source) Returns the target nodes for the given source node.voidnodeDeleted(V node) Used to notify when a node is deleted from the graph.voidnodeInserted(V n) Used to notify when a node is inserted into the graph.toString()
-
Constructor Details
-
IBiDirectionalWrapper
-
-
Method Details
-
attachObserver
Description copied from interface:IGraphDataSourceAttaches a new graph observer to this graph data source. Observers will be notified in the order they have been registered.- Specified by:
attachObserverin interfaceIGraphDataSource<V>- Parameters:
observer- the graph observer
-
attachAsFirstObserver
Description copied from interface:IGraphDataSourceAttaches 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.- Specified by:
attachAsFirstObserverin interfaceIGraphDataSource<V>- Parameters:
observer- the graph observer
-
detachObserver
Description copied from interface:IGraphDataSourceDetaches an already registered graph observer from this graph data source.- Specified by:
detachObserverin interfaceIGraphDataSource<V>- Parameters:
observer- the graph observer
-
getAllNodes
Description copied from interface:IGraphDataSourceReturns the complete set of nodes in the graph data source.- Specified by:
getAllNodesin interfaceIGraphDataSource<V>- Returns:
- the set of all nodes
-
getTargetNodes
Description copied from interface:IGraphDataSourceReturns the target nodes for the given source node. The returned data structure is anIMultisetbecause of potential parallel edges in the graph data source. The method must not return null.- Specified by:
getTargetNodesin interfaceIGraphDataSource<V>- Parameters:
source- the source node- Returns:
- the multiset of target nodes
-
getSourceNodes
Description copied from interface:IBiDirectionalGraphDataSourceReturns the source nodes for the given target node. The returned data structure is anIMultisetbecause of potential parallel edges in the graph data source. The method must not return null.- Specified by:
getSourceNodesin interfaceIBiDirectionalGraphDataSource<V>- Parameters:
target- the target node- Returns:
- the multiset of source nodes
-
edgeInserted
Description copied from interface:IGraphObserverUsed to notify when an edge is inserted into the graph.- Specified by:
edgeInsertedin interfaceIGraphObserver<V>- Parameters:
source- the source of the edgetarget- the target of the edge
-
edgeDeleted
Description copied from interface:IGraphObserverUsed to notify when an edge is deleted from the graph.- Specified by:
edgeDeletedin interfaceIGraphObserver<V>- Parameters:
source- the source of the edgetarget- the target of the edge
-
nodeInserted
Description copied from interface:IGraphObserverUsed to notify when a node is inserted into the graph.- Specified by:
nodeInsertedin interfaceIGraphObserver<V>- Parameters:
n- the node
-
nodeDeleted
Description copied from interface:IGraphObserverUsed to notify when a node is deleted from the graph.- Specified by:
nodeDeletedin interfaceIGraphObserver<V>- Parameters:
node- the node
-
toString
-