net.sf.freecol.common.model
Class Map.AdjacentIterator

java.lang.Object
  extended by net.sf.freecol.common.model.Map.MapIterator
      extended by net.sf.freecol.common.model.Map.AdjacentIterator
All Implemented Interfaces:
java.util.Iterator<Map.Position>
Enclosing class:
Map

private final class Map.AdjacentIterator
extends Map.MapIterator


Field Summary
private  Map.Position basePosition
           
private  int x
           
 
Fields inherited from class net.sf.freecol.common.model.Map.MapIterator
directions
 
Constructor Summary
Map.AdjacentIterator(Map.Position basePosition)
          The constructor to use.
 
Method Summary
 boolean hasNext()
          Determine if the iterator has another position in it.
 Map.Position nextPosition()
          Obtain the next position to iterate over.
 
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

basePosition

private Map.Position basePosition

x

private int x
Constructor Detail

Map.AdjacentIterator

public Map.AdjacentIterator(Map.Position basePosition)
The constructor to use.

Parameters:
basePosition - The position around which to iterate
Method Detail

hasNext

public boolean hasNext()
Determine if the iterator has another position in it.

Returns:
True of there is another position

nextPosition

public Map.Position nextPosition()
                          throws java.util.NoSuchElementException
Obtain the next position to iterate over.

Specified by:
nextPosition in class Map.MapIterator
Returns:
Next position
Throws:
java.util.NoSuchElementException - if last position already returned