Class Graph<V>
java.lang.Object
tools.refinery.interpreter.rete.itc.graphimpl.Graph<V>
- All Implemented Interfaces:
IBiDirectionalGraphDataSource<V>,IGraphDataSource<V>
public class Graph<V>
extends Object
implements IGraphDataSource<V>, IBiDirectionalGraphDataSource<V>
-
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.voidAttaches a new graph observer to this graph data source.voiddeleteEdge(V source, V target) Deprecated.voiddeleteEdgeIfExists(V source, V target) No-op if trying to delete edge that does not existvoiddeleteEdgeThatExists(V source, V target) voiddeleteNode(V node) Deletes the given node AND all of the edges going in and out from the node.voidDetaches an already registered graph observer from this graph data source.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.voidinsertEdge(V source, V target) voidinsertNode(V node) Insert the given node into the graph.toString()
-
Constructor Details
-
Graph
public Graph()
-
-
Method Details
-
insertEdge
-
deleteEdgeIfExists
No-op if trying to delete edge that does not exist- Since:
- 2.0
- See Also:
-
deleteEdgeThatExists
- Throws:
IllegalStateException- if trying to delete edge that does not exist- Since:
- 2.0
- See Also:
-
deleteEdge
Deprecated.use explicitlydeleteEdgeThatExists(Object, Object)ordeleteEdgeIfExists(Object, Object)instead. To preserve backwards compatibility, this method delegates to the latter. -
insertNode
Insert the given node into the graph. -
deleteNode
Deletes the given node AND all of the edges going in and out from the node. -
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:
go- 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:
go- 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
-
toString
-
deleteEdgeThatExists(Object, Object)ordeleteEdgeIfExists(Object, Object)instead.