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)
IGraphDataSourceattachObserver in interface IGraphDataSource<V>go - the graph observerpublic void attachAsFirstObserver(IGraphObserver<V> observer)
IGraphDataSourceattachAsFirstObserver in interface IGraphDataSource<V>observer - the graph observerpublic void detachObserver(IGraphObserver<V> go)
IGraphDataSourcedetachObserver in interface IGraphDataSource<V>go - the graph observerpublic java.util.Set<V> getAllNodes()
IGraphDataSourcegetAllNodes in interface IGraphDataSource<V>public java.util.Map<V,java.lang.Integer> getTargetNodes(V source)
IGraphDataSourcegetTargetNodes in interface IGraphDataSource<V>source - the source nodepublic java.util.Map<V,java.lang.Integer> getSourceNodes(V target)
IBiDirectionalGraphDataSourcegetSourceNodes in interface IBiDirectionalGraphDataSource<V>target - the target nodepublic java.lang.String toString()
toString in class java.lang.Objectpublic 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()