|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ed.inf.graph.impl.Node
public final class Node
Constructor Summary | |
---|---|
Node(Graph owningGraph,
int index)
Creates a new node belonging to a graph. |
Method Summary | |
---|---|
(package private) void |
addEdge(Edge edge)
|
int |
compareTo(Node o)
Compare this node to another node. |
java.util.Iterator<Node> |
connectedNodeIterator()
Provides an iterator that lists all nodes connected to this node via another edge. |
java.util.Iterator<Edge> |
edgeIterator()
Provides an iterator that lists all edges associated with this node. |
boolean |
equals(java.lang.Object obj)
Is the other node equal to this one. |
int |
getDegree()
Get the degree of the this node. |
java.util.SortedSet<Edge> |
getEdgesWith(Node other)
Gets the edges shared with the other node. |
Graph |
getGraph()
Get the graph that owns this node. |
int |
getIndex()
Get the index of this node. |
boolean |
hasEdgeWith(Node other)
Tests whether this node shares one or more edges with another node, irrespective of the direction of that edge. |
int |
hashCode()
Get the hash code for this node. |
boolean |
isRemoved()
Has the node been removed from the graph? Nodes are not removed from the graph's data structures, but flagged as deleted. |
void |
markRemoved(boolean removeFlag)
Used to reset the removal status of a graph edge or node. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
Node(Graph owningGraph, int index)
owningGraph
- The graph to which this node belongs.index
- The identifying index for the node, that
can be used to lookup this node from the graph.
java.lang.IllegalArgumentException
- if owningGraph is null.
java.lang.IllegalArgumentException
- if index is negative.Method Detail |
---|
public java.util.Iterator<Node> connectedNodeIterator()
IBasicNode
connectedNodeIterator
in interface IBasicNode<Node,Edge>
public int getDegree()
IBasicNode
getDegree
in interface IBasicNode<Node,Edge>
public java.util.Iterator<Edge> edgeIterator()
IBasicNode
edgeIterator
in interface IBasicNode<Node,Edge>
public java.util.SortedSet<Edge> getEdgesWith(Node other)
IBasicNode
getEdgesWith
in interface IBasicNode<Node,Edge>
other
- The other node to test. Cannot be null.
public Graph getGraph()
IBasicNode
getGraph
in interface IBasicNode<Node,Edge>
public int getIndex()
IBasicNode
getIndex
in interface IBasicNode<Node,Edge>
public boolean hasEdgeWith(Node other)
IBasicNode
hasEdgeWith
in interface IBasicNode<Node,Edge>
other
- The other node to test. Can be null.
void addEdge(Edge edge)
public int compareTo(Node o)
IBasicNode
compareTo
in interface java.lang.Comparable<Node>
compareTo
in interface IBasicNode<Node,Edge>
o
- the other node to compare to.public int hashCode()
IBasicNode
equals
.
hashCode
in interface IBasicNode<Node,Edge>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
IBasicNode
equals
, and in addition
a node should be regarded as equal if its owning graph and index are identical.
equals
in interface IBasicNode<Node,Edge>
equals
in class java.lang.Object
obj
- the other object to be tested.
public boolean isRemoved()
IBasicNode
isRemoved
in interface IBasicNode<Node,Edge>
public void markRemoved(boolean removeFlag)
IRestorableGraphElement
markRemoved
in interface IRestorableGraphElement
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |