edu.uci.ics.dillenco.simplegraph01
Class Node

java.lang.Object
  extended by edu.uci.ics.dillenco.simplegraph01.Node

public class Node
extends Object


Field Summary
 byte permID
           
 
Constructor Summary
Node(Graph g)
           
 
Method Summary
 char charName()
           
 int getDegree()
          Return the number of edges incident on this node.
 Iterable<HalfEdge> getHalfEdges()
          Returns an iterable with an iterator that runs through all HalfEdges having this node as origin, in positive order about this node.
 Iterable<HalfEdge> getHalfEdges(HalfEdge startHalfEdge)
          Returns an iterable with an iterator that runs through all HalfEdges having this node as origin, in positive order about this node, and with a specified starting edge.
 Iterable<HalfEdge> getInHalfEdges()
          Returns an iterable with an iterator that runs through all HalfEdges that have this node as origin and are directed toward this node.
 Iterable<Node> getNeighbors()
          Returns an iterable with an iterator that runs through all neighbors of this node.
 Iterable<Node> getNeighbors(HalfEdge startHalfEdge)
          Returns an iterable with an iterator that runs through all neighbors of this node, with a specified starting edge.
 Iterable<HalfEdge> getOutHalfEdges()
          Return an iterable with an iterator that runs through all HalfEdges that have this node as origin and are directed away from this node.
 int getPermID()
          Return the permanent ID of this node.
 int getSeqID()
          Return the sequential ID of this node.
 void link(QEdge qEdge)
          Link the specified edge into the rotation system at this node.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

permID

public final byte permID
Constructor Detail

Node

Node(Graph g)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getSeqID

public int getSeqID()
Return the sequential ID of this node. The sequential ID's of the nodes change over time with insertions and deletions. At any time, if n is the number of nodes in the graph, each node in the graph will be assigned a unique number in the range 0..n-1.

Returns:
the sequential ID of the node.

getPermID

public int getPermID()
Return the permanent ID of this node. The permanent ID of the node does not change. The permanent ID of each node is unique within a graph.

Returns:
the permanent ID of the node.

charName

public char charName()

getDegree

public int getDegree()
Return the number of edges incident on this node.

Returns:
the degree of the node.

getHalfEdges

public Iterable<HalfEdge> getHalfEdges()
Returns an iterable with an iterator that runs through all HalfEdges having this node as origin, in positive order about this node. The iterator only supports the hasNext() and next() methods. If remove() is called on the returned iterator, an UnsupportedOperationException will be thrown.

Returns:
an iterable for the HalfEdges that have this node as origin.

getHalfEdges

public Iterable<HalfEdge> getHalfEdges(HalfEdge startHalfEdge)
Returns an iterable with an iterator that runs through all HalfEdges having this node as origin, in positive order about this node, and with a specified starting edge. The iterator only supports the hasNext() and next() methods. If remove() is called on the returned iterator, an UnsupportedOperationException will be thrown.

Parameters:
startHalfEdge - the starting HalfEdge for the iteration
Returns:
an iterable for the HalfEdges that have this node as origin.

getInHalfEdges

public Iterable<HalfEdge> getInHalfEdges()
Returns an iterable with an iterator that runs through all HalfEdges that have this node as origin and are directed toward this node. The iterator only supports the hasNext() and next() methods. If remove() is called on the returned iterator, an UnsupportedOperationException will be thrown.

Returns:
an iterable for the HalfEdges that have this node as origin and are directed toward this node.

getOutHalfEdges

public Iterable<HalfEdge> getOutHalfEdges()
Return an iterable with an iterator that runs through all HalfEdges that have this node as origin and are directed away from this node. The iterator only supports the hasNext() and next() methods. If remove() is called on the returned iterator, an UnsupportedOperationException will be thrown.

Returns:
an iterable for the HalfEdges that have this node as origin and are directed away from this node.

getNeighbors

public Iterable<Node> getNeighbors()
Returns an iterable with an iterator that runs through all neighbors of this node. The sequence of nodes is the same as that which would be obtained by calling getHalfEdges() and looking at the resulting sequence of neighbor nodes. The iterator only supports the hasNext() and next() methods. If remove() is called on the returned iterator, an UnsupportedOperationException will be thrown.

Returns:
an iterable for the neighbors of this node.

getNeighbors

public Iterable<Node> getNeighbors(HalfEdge startHalfEdge)
Returns an iterable with an iterator that runs through all neighbors of this node, with a specified starting edge. The sequence of nodes is the same as that which would be obtained by calling getHalfEdges() and looking at the resulting sequence of neighbor nodes. The iterator only supports the hasNext() and next() methods. If remove() is called on the returned iterator, an UnsupportedOperationException will be thrown.

Parameters:
startHalfEdge - the starting HalfEdge for the iteration
Returns:
an iterable for the neighbors of this node.

link

public void link(QEdge qEdge)
Link the specified edge into the rotation system at this node. Successive calls to link at the same node will be arranged in positive order. Note that this call will not handle loops correctly.

Parameters:
qEdge - the QEdge to be linked