public class Graph<V> extends java.lang.Object implements IGraphDataSource<V>, IBiDirectionalGraphDataSource<V>
Constructor and Description |
---|
Graph() |
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> go)
Attaches a new graph observer to this graph data source.
|
void |
deleteEdge(V source,
V target) |
void |
deleteNode(V node) |
java.lang.Integer[] |
deleteRandomEdge() |
void |
detachObserver(IGraphObserver<V> go)
Detaches an already registered graph observer from this graph data source.
|
java.lang.String |
generateDot() |
java.lang.String |
generateDot(boolean colorSCCs,
com.google.common.base.Function<V,java.lang.String> nameMapper,
com.google.common.base.Function<V,java.lang.String> colorMapper) |
java.util.Set<V> |
getAllNodes()
Returns the complete set of nodes in the graph data source.
|
java.util.Map<V,java.lang.Integer> |
getSourceNodes(V target)
Returns the source nodes for the given target node.
|
java.util.Map<V,java.lang.Integer> |
getTargetNodes(V source)
Returns the target nodes for the given source node.
|
void |
insertEdge(V source,
V target) |
void |
insertNode(V node) |
java.lang.Integer[] |
insertRandomEdge() |
java.lang.String |
toString() |
public void insertNode(V node)
public void deleteNode(V node)
public void attachObserver(IGraphObserver<V> go)
IGraphDataSource
attachObserver
in interface IGraphDataSource<V>
go
- the graph observerpublic void attachAsFirstObserver(IGraphObserver<V> observer)
IGraphDataSource
attachAsFirstObserver
in interface IGraphDataSource<V>
observer
- the graph observerpublic void detachObserver(IGraphObserver<V> go)
IGraphDataSource
detachObserver
in interface IGraphDataSource<V>
go
- the graph observerpublic java.util.Set<V> getAllNodes()
IGraphDataSource
getAllNodes
in interface IGraphDataSource<V>
public java.util.Map<V,java.lang.Integer> getTargetNodes(V source)
IGraphDataSource
getTargetNodes
in interface IGraphDataSource<V>
source
- the source nodepublic java.util.Map<V,java.lang.Integer> getSourceNodes(V target)
IBiDirectionalGraphDataSource
getSourceNodes
in interface IBiDirectionalGraphDataSource<V>
target
- the target nodepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String generateDot(boolean colorSCCs, com.google.common.base.Function<V,java.lang.String> nameMapper, com.google.common.base.Function<V,java.lang.String> colorMapper)
public java.lang.String generateDot()
public java.lang.Integer[] deleteRandomEdge()
public java.lang.Integer[] insertRandomEdge()