org.graffiti.plugins.algorithms.reingoldtilford
Interface ContourNodeIterator

All Superinterfaces:
Cloneable

public interface ContourNodeIterator
extends Cloneable

Defines an interface for classes that act as iterators pointing to a contour node in a ContourNodeList or to null.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Method Summary
 ContourNodeIterator clone()
          Returns a copy of this ContourNodeIterator.
 org.graffiti.plugins.algorithms.reingoldtilford.BasicContourNodeList.Iterator getBaseIterator()
          Returns an new iterator pointing to the node in the original BasicContourNodeList with the greatest y-coordinate less than or equal to the y-coordinate of the contour node this iterator is pointing to.
 double getDx()
          The x-coordinate of the contour node this iterator is pointing to relative to the position of its predecessor in the contour list.
 double getDy()
          The y-coordinate of the contour node this iterator is pointing to relative to the position of its predecessor in the contour list.
 double getX()
          Returns the absolute x-coordinate of the contour node this iterator is pointing to.
 double getY()
          Returns the absolute y-coordinate of the contour node this iterator is pointing to.
 void increment()
          After a call to increment() this iterator points to the successor of the contour node this iterator was pointing to before or null if this was pointing to the last node in its contour.
 boolean isEnd()
          Returns if this iterator points to the last contour node in its ContourNodeList.
 boolean isLast()
          Returns if this iterator points to null.
 

Method Detail

getX

double getX()
Returns the absolute x-coordinate of the contour node this iterator is pointing to. The origin of the coordinate system is considered to be the top left corner of the Node that is the root of the tree to which the contour node's ContourNodeList belongs.

Preconditions:
This iterator must not point to null.

Returns:
the absolute x-coordinate of the contour node this iterator is pointing to.
Throws:
NoSuchElementException - if this iterator points to null.

getY

double getY()
Returns the absolute y-coordinate of the contour node this iterator is pointing to. The origin of the coordinate system is considered to be the top left corner of the Node that is the root of the tree to which the contour node's ContourNodeList belongs.

Preconditions:
This iterator must not point to null.

Returns:
the absolute y-coordinate of the contour node this iterator is pointing to.
Throws:
NoSuchElementException - if this iterator points to null.

getDx

double getDx()
The x-coordinate of the contour node this iterator is pointing to relative to the position of its predecessor in the contour list.

Preconditions:
This iterator must not point to null.

Returns:
the x-coordinate of the contour node this iterator is pointing to relative to the position of its predecessor in the contour list.
Throws:
NoSuchElementException - if this iterator points to null.

getDy

double getDy()
The y-coordinate of the contour node this iterator is pointing to relative to the position of its predecessor in the contour list.

Preconditions:
This iterator must not point to null.

Returns:
the y-coordinate of the contour node this iterator is pointing to relative to the position of its predecessor in the contour list.
Throws:
NoSuchElementException - if this iterator points to null.

increment

void increment()
After a call to increment() this iterator points to the successor of the contour node this iterator was pointing to before or null if this was pointing to the last node in its contour.

Preconditions:
This iterator must not point to null.

Throws:
NoSuchElementException - if this iterator points to null.

isEnd

boolean isEnd()
Returns if this iterator points to the last contour node in its ContourNodeList.

Returns:
true if this iterator points to the last contour node in its ContourNodeList.
false otherwise.

isLast

boolean isLast()
Returns if this iterator points to null.

Returns:
true if this iterator points to null.
false otherwise.

getBaseIterator

org.graffiti.plugins.algorithms.reingoldtilford.BasicContourNodeList.Iterator getBaseIterator()
Returns an new iterator pointing to the node in the original BasicContourNodeList with the greatest y-coordinate less than or equal to the y-coordinate of the contour node this iterator is pointing to.

Returns:
an new iterator pointing to the node in the original BasicContourNodeList with the greatest y-coordinate less than or equal to the y-coordinate of the contour node this iterator is pointing to.

clone

ContourNodeIterator clone()
Returns a copy of this ContourNodeIterator.

Returns:
a copy of this ContourNodeIterator.


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