org.graffiti.plugins.algorithms.mnn
Class CanonicalOrdering

java.lang.Object
  extended by org.graffiti.plugins.algorithms.mnn.CanonicalOrdering
All Implemented Interfaces:
Iterator<CanonicalOrderingNode>
Direct Known Subclasses:
CanonicalDepomposition, ExtendedCanonicalOrdering

public class CanonicalOrdering
extends Object
implements Iterator<CanonicalOrderingNode>

This class calculates a 4-canonical ordering for an embedding of a given planar graph


Constructor Summary
CanonicalOrdering()
          Constructor
CanonicalOrdering(EmbeddedGraph embeddedGraph)
          Constructor
 
Method Summary
 void getAll()
          switches tho the "all-nodes"-mode
 ArrayList<CanonicalOrderingNode> getCanonicalOrdering()
          returns a list of canonical ordering nodes in the correct order
 void getFirstHalf()
          switches tho the "first-half"-mode
 Collection<Node> getNodes()
          returns all the nodes, the nodes of the first or the second half
 int getNumberOfNodes()
          returns the nuber of nodes
 void getSecondHalf()
          switches tho the "second-half"-mode
 Collection<Node> getSmallerNeighbours(CanonicalOrderingNode con)
          returns the smaller neighbours of a node (the nighbours of a node with a smaller ordering number
 boolean hasNext()
          returns true, if there is another node in the canonical ordering
 CanonicalOrderingNode next()
          returns the next node of the ordering
 void remove()
          only necessery for the iterator interface
 String toString()
          toString()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CanonicalOrdering

public CanonicalOrdering(EmbeddedGraph embeddedGraph)
Constructor


CanonicalOrdering

public CanonicalOrdering()
Constructor

Method Detail

getSmallerNeighbours

public Collection<Node> getSmallerNeighbours(CanonicalOrderingNode con)
returns the smaller neighbours of a node (the nighbours of a node with a smaller ordering number

Parameters:
con - the CanonicalOrderingNode
Returns:
the smaller neighbours

hasNext

public boolean hasNext()
returns true, if there is another node in the canonical ordering

Specified by:
hasNext in interface Iterator<CanonicalOrderingNode>

next

public CanonicalOrderingNode next()
returns the next node of the ordering

Specified by:
next in interface Iterator<CanonicalOrderingNode>

remove

public void remove()
only necessery for the iterator interface

Specified by:
remove in interface Iterator<CanonicalOrderingNode>

getNodes

public Collection<Node> getNodes()
returns all the nodes, the nodes of the first or the second half

Returns:
the nodes

getFirstHalf

public void getFirstHalf()
switches tho the "first-half"-mode


getSecondHalf

public void getSecondHalf()
switches tho the "second-half"-mode


getAll

public void getAll()
switches tho the "all-nodes"-mode


getNumberOfNodes

public int getNumberOfNodes()
returns the nuber of nodes

Returns:
the number of nodes

getCanonicalOrdering

public ArrayList<CanonicalOrderingNode> getCanonicalOrdering()
returns a list of canonical ordering nodes in the correct order

Returns:
the canonical ordring of the nodes

toString

public String toString()
toString()

Overrides:
toString in class Object


Generated at 2012-05-30 11:01:25 PM CEST