|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.util.Bresenham
An object that takes two endpoints and returns all the points on the line between them (including the endpoints).
This class is NOT thread-safe; don't access it from multiple threads.
Constructor Summary | |
Bresenham(int x1,
int y1,
int x2,
int y2)
Constructs a new Bresenham iterator between two points. |
|
Bresenham(Point p1,
Point p2)
Constructs a new Bresenham iterator between two points. |
Method Summary | |
boolean |
hasNext()
Implements java.util.Iterator.hasNext(); |
static void |
main(java.lang.String[] argv)
Tests the output. |
java.lang.Object |
next()
Implements java.util.Iterator.next(); |
void |
remove()
Removes the element on the line. |
void |
reset(int x1,
int y1,
int x2,
int y2)
Resets all the state variables for a new line. |
java.lang.String |
toString()
Returns String representation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Bresenham(Point p1, Point p2)
p1
- the start pointp2
- the end pointpublic Bresenham(int x1, int y1, int x2, int y2)
x1
- X coordinate of start pointy1
- Y coordinate of start pointx2
- X coordinate of end pointy2
- Y coordinate of end pointMethod Detail |
public void reset(int x1, int y1, int x2, int y2)
x1
- X coordinate of start pointy1
- Y coordinate of start pointx2
- X coordinate of end pointy2
- Y coordinate of end pointpublic boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
UnsupportedOperationException,
- unless a subclass
wants to handle this method.public java.lang.String toString()
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |