|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttipgame.util.RectangularGridIterator
public class RectangularGridIterator
iterates over the bounds of a rectangle for a given grid.
| Field Summary | |
|---|---|
private java.awt.geom.Rectangle2D.Double |
bounds
the size of the rectangle to contain the points |
private java.awt.Point |
pointIndex
the index of the current point in the iterator |
private java.awt.Dimension |
points
the number of rows and columns of points to create |
| Constructor Summary | |
|---|---|
RectangularGridIterator(java.awt.geom.Rectangle2D.Double bound,
java.awt.Dimension elements)
constructs the iterator over the bounds for a given number of rows and columns. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
|
java.lang.Object |
next()
gets the points staring at the top left going left to right, then top to bottom |
void |
remove()
goes to the next point |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.awt.geom.Rectangle2D.Double bounds
private java.awt.Dimension points
private java.awt.Point pointIndex
| Constructor Detail |
|---|
public RectangularGridIterator(java.awt.geom.Rectangle2D.Double bound,
java.awt.Dimension elements)
bound - how large an area is available for the cellselements - the number of rows and columns in bounds| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.IteratorIterator.hasNext()public java.lang.Object next()
next in interface java.util.IteratorIterator.next()public void remove()
remove in interface java.util.IteratorIterator.remove()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||