|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.touchgraph.graphlayout.graphelements.GraphEltSet
GraphEltSet contains data about the graph's components. Currently the only components are edges and nodes.
| Field Summary | |
protected java.util.Vector |
edges
|
protected java.util.Hashtable |
nodeIDRegistry
The Hashtable containing references to the Node IDs of the current graph. |
protected java.util.Vector |
nodes
|
| Constructor Summary | |
GraphEltSet()
Default constructor. |
|
| Method Summary | |
void |
addEdge(Edge edge)
Add the Edge edge to the graph. |
Edge |
addEdge(Node from,
Node to,
int tension)
Add an Edge from Node from to Node to, with tension of int tension, returning the Edge. |
void |
addNode(Node node)
Add the Node node to the graph, and registers the Node via its ID. |
void |
clearAll()
Clear all nodes and edges. |
boolean |
contains(Edge edge)
Returns true if the graph contains the Edge edge. |
boolean |
contains(Node node)
Returns true if the graph contains the Node node. |
boolean |
deleteEdge(Edge edge)
Delete the Edge edge. |
boolean |
deleteEdge(Node from,
Node to)
Delete the Edge spanning Node from to Node to, returning true if successful. |
void |
deleteEdges(java.util.Vector edgesToDelete)
Delete the Edges contained within the Vector edgedToDelete. |
boolean |
deleteNode(Node node)
Delete the Node node, returning true if successful. |
void |
deleteNodes(java.util.Vector nodesToDelete)
Delete the Nodes contained within the Vector nodesToDelete. |
protected Edge |
edgeAt(int index)
Return the Edge at int index, null if none are available. |
int |
edgeCount()
Return the number of Edges in the cumulative Vector. |
int |
edgeNum()
Deprecated. this method has been replaced by the edgeCount() method. |
Edge |
findEdge(Node from,
Node to)
Return an Edge spanning Node from to Node to. |
Node |
findNode(java.lang.String id)
Return the Node whose ID matches the String id, null if no match is found. |
Node |
findNodeLabelContaining(java.lang.String substring)
Return the first Nodes whose label contains the String substring, null if no match is found. |
java.util.Collection |
findNodesByLabel(java.lang.String label)
Return a Collection of all Nodes whose label matches the String label, null if no match is found. |
void |
forAllEdges(TGForEachEdge fee)
Iterates through Edges. |
void |
forAllNodePairs(TGForEachNodePair fenp)
iterates through pairs of Nodes. |
void |
forAllNodes(TGForEachNode fen)
A way of iterating through all the nodes. |
java.util.Iterator |
getEdges()
Return an iterator over the Edges in the cumulative Vector, null if it is empty. |
Node |
getFirstNode()
Return the first Node, null if none exist. |
java.util.Iterator |
getNodes()
Return an iterator over the Nodes in the cumulative Vector, null if it is empty. |
Node |
getRandomNode()
Returns a random node, or null if none exist (for making random graphs). |
protected Node |
nodeAt(int i)
Return the Node at int index, null if none are available. |
int |
nodeCount()
Return the number of Nodes in the cumulative Vector. |
int |
nodeNum()
Deprecated. this method has been replaced by the nodeCount() method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Vector nodes
protected java.util.Vector edges
protected java.util.Hashtable nodeIDRegistry
| Constructor Detail |
public GraphEltSet()
| Method Detail |
protected Node nodeAt(int i)
public int nodeNum()
nodeNum in interface ImmutableGraphEltSetpublic int nodeCount()
nodeCount in interface ImmutableGraphEltSetpublic java.util.Iterator getNodes()
getNodes in interface ImmutableGraphEltSet
public void addNode(Node node)
throws TGException
TGExceptionpublic boolean contains(Node node)
protected Edge edgeAt(int index)
public int edgeNum()
edgeNum in interface ImmutableGraphEltSetpublic int edgeCount()
edgeCount in interface ImmutableGraphEltSetpublic java.util.Iterator getEdges()
getEdges in interface ImmutableGraphEltSetpublic void addEdge(Edge edge)
public Edge addEdge(Node from,
Node to,
int tension)
public boolean contains(Edge edge)
public Node findNode(java.lang.String id)
findNode in interface ImmutableGraphEltSetpublic java.util.Collection findNodesByLabel(java.lang.String label)
findNodesByLabel in interface ImmutableGraphEltSetpublic Node findNodeLabelContaining(java.lang.String substring)
findNodeLabelContaining in interface ImmutableGraphEltSet
public Edge findEdge(Node from,
Node to)
findEdge in interface ImmutableGraphEltSetpublic boolean deleteEdge(Edge edge)
public void deleteEdges(java.util.Vector edgesToDelete)
public boolean deleteEdge(Node from,
Node to)
public boolean deleteNode(Node node)
public void deleteNodes(java.util.Vector nodesToDelete)
public Node getRandomNode()
getRandomNode in interface ImmutableGraphEltSetpublic Node getFirstNode()
getFirstNode in interface ImmutableGraphEltSetpublic void clearAll()
public void forAllNodes(TGForEachNode fen)
forAllNodes in interface ImmutableGraphEltSetpublic void forAllNodePairs(TGForEachNodePair fenp)
forAllNodePairs in interface ImmutableGraphEltSetpublic void forAllEdges(TGForEachEdge fee)
forAllEdges in interface ImmutableGraphEltSet
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||