|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucla.stat.SOCR.touchgraph.graphlayout.graphelements.GraphEltSet
public class 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 |
findNodeByURL(java.lang.String strURL)
Return the Node whose URL matches the String strURL, 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. |
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. |
Node |
getFirstNode()
Return the first Node, null if none exist. |
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 ImmutableGraphEltSet
public int nodeCount()
nodeCount
in interface ImmutableGraphEltSet
public void addNode(Node node) throws TGException
TGException
public boolean contains(Node node)
protected Edge edgeAt(int index)
public int edgeNum()
edgeNum
in interface ImmutableGraphEltSet
public int edgeCount()
edgeCount
in interface ImmutableGraphEltSet
public 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 ImmutableGraphEltSet
public Node findNodeByURL(java.lang.String strURL)
public Node findNodeLabelContaining(java.lang.String substring)
findNodeLabelContaining
in interface ImmutableGraphEltSet
public Edge findEdge(Node from, Node to)
findEdge
in interface ImmutableGraphEltSet
public 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 ImmutableGraphEltSet
public Node getFirstNode()
getFirstNode
in interface ImmutableGraphEltSet
public void clearAll()
public void forAllNodes(TGForEachNode fen)
forAllNodes
in interface ImmutableGraphEltSet
public void forAllNodePairs(TGForEachNodePair fenp)
forAllNodePairs
in interface ImmutableGraphEltSet
public void forAllEdges(TGForEachEdge fee)
forAllEdges
in interface ImmutableGraphEltSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |