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

java.lang.Object
  extended by net.sf.freecol.common.model.Map.MapIterator
All Implemented Interfaces:
java.util.Iterator<Map.Position>
Direct Known Subclasses:
Map.AdjacentIterator, Map.BorderAdjacentIterator, Map.CircleIterator, Map.WholeMapIterator
Enclosing class:
Map

private abstract class Map.MapIterator
extends java.lang.Object
implements java.util.Iterator<Map.Position>

Base class for internal iterators.


Field Summary
protected  Map.Direction[] directions
           
 
Constructor Summary
private Map.MapIterator()
           
 
Method Summary
 Map.Position next()
          Returns the next element in the iteration.
abstract  Map.Position nextPosition()
          Get the next position as a position rather as an object.
 void remove()
          Removes from the underlying collection the last element returned by the iterator (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
hasNext
 

Field Detail

directions

protected Map.Direction[] directions
Constructor Detail

Map.MapIterator

private Map.MapIterator()
Method Detail

nextPosition

public abstract Map.Position nextPosition()
                                   throws java.util.NoSuchElementException
Get the next position as a position rather as an object.

Returns:
position.
Throws:
java.util.NoSuchElementException - if iterator is exhausted.

next

public Map.Position next()
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator<Map.Position>
Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation).

Specified by:
remove in interface java.util.Iterator<Map.Position>
Throws:
java.lang.UnsupportedOperationException - no matter what.