|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.Map.MapIterator
net.sf.freecol.common.model.Map.CircleIterator
public final class Map.CircleIterator
An interator returning positions in a spiral starting at a given center tile. The center tile is never included in the positions returned, and all returned positions are valid.
Map.Position| Field Summary | |
|---|---|
private int |
currentRadius
|
private int |
n
|
private Map.Position |
nextPosition
|
private int |
radius
|
| Fields inherited from class net.sf.freecol.common.model.Map.MapIterator |
|---|
directions |
| Constructor Summary | |
|---|---|
Map.CircleIterator(Map.Position center,
boolean isFilled,
int radius)
The constructor to use. |
|
| Method Summary | |
|---|---|
private void |
determineNextPosition()
Finds the next position. |
int |
getCurrentRadius()
Returns the current radius of the circle. |
boolean |
hasNext()
Determine if the iterator has another position in it. |
Map.Position |
nextPosition()
Obtains the next position. |
| Methods inherited from class net.sf.freecol.common.model.Map.MapIterator |
|---|
next, remove |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int radius
private int currentRadius
private Map.Position nextPosition
private int n
| Constructor Detail |
|---|
public Map.CircleIterator(Map.Position center,
boolean isFilled,
int radius)
center - The center of the circleisFilled - True to get all of the positions within the circleradius - The radius of the circle| Method Detail |
|---|
public int getCurrentRadius()
CircleIterator was initialized with.private void determineNextPosition()
public boolean hasNext()
true of there is another position and
false otherwise.public Map.Position nextPosition()
nextPosition in class Map.MapIteratorvalid.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||