| |
|
| java.lang.Object javax.imageio.spi.DigraphNode
DigraphNode | class DigraphNode implements Cloneable,Serializable(Code) | | A node in a directed graph. In addition to an arbitrary
Object containing user data associated with the node,
each node maintains a Set s of nodes which are pointed
to by the current node (available from getOutNodes ).
The in-degree of the node (that is, number of nodes that point to
the current node) may be queried.
version: 0.5 |
Field Summary | |
protected Object | data The data associated with this node. | protected int | inDegree The in-degree of the node. | protected Set | outNodes A Set of neighboring nodes pointed to by this
node. |
Method Summary | |
public boolean | addEdge(DigraphNode node) Adds a directed edge to the graph. | public void | dispose() Removes this node from the graph, updating neighboring nodes
appropriately. | public Object | getData() Returns the Object referenced by this node. | public int | getInDegree() Returns the in-degree of this node. | public Iterator | getOutNodes() Returns an Iterator containing the nodes pointed
to by this node. | public boolean | hasEdge(DigraphNode node) Returns true if an edge exists between this node
and the given node.
Parameters: node - a DigraphNode . | public boolean | removeEdge(DigraphNode node) Removes a directed edge from the graph. |
data | protected Object data(Code) | | The data associated with this node.
|
inDegree | protected int inDegree(Code) | | The in-degree of the node.
|
outNodes | protected Set outNodes(Code) | | A Set of neighboring nodes pointed to by this
node.
|
addEdge | public boolean addEdge(DigraphNode node)(Code) | | Adds a directed edge to the graph. The outNodes list of this
node is updated and the in-degree of the other node is incremented.
Parameters: node - a DigraphNode . true if the node was not previously thetarget of an edge. |
dispose | public void dispose()(Code) | | Removes this node from the graph, updating neighboring nodes
appropriately.
|
getData | public Object getData()(Code) | | Returns the Object referenced by this node.
|
getInDegree | public int getInDegree()(Code) | | Returns the in-degree of this node.
|
getOutNodes | public Iterator getOutNodes()(Code) | | Returns an Iterator containing the nodes pointed
to by this node.
|
hasEdge | public boolean hasEdge(DigraphNode node)(Code) | | Returns true if an edge exists between this node
and the given node.
Parameters: node - a DigraphNode . true if the node is the target of an edge. |
removeEdge | public boolean removeEdge(DigraphNode node)(Code) | | Removes a directed edge from the graph. The outNodes list of this
node is updated and the in-degree of the other node is decremented.
true if the node was previously the targetof an edge. |
|
|
|