net.sf.freecol.common.model
Class Player.UnitIterator

java.lang.Object
  extended by net.sf.freecol.common.model.Player.UnitIterator
All Implemented Interfaces:
java.util.Iterator<Unit>
Enclosing class:
Player

public class Player.UnitIterator
extends java.lang.Object
implements java.util.Iterator<Unit>

An Iterator of Units that can be made active.


Constructor Summary
Player.UnitIterator(Player owner, Player.UnitPredicate predicate)
          Creates a new NextActiveUnitIterator.
 
Method Summary
 boolean hasNext()
           
 Unit next()
           
 void remove()
          Removes from the underlying collection the last element returned by the iterator (optional operation).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Player.UnitIterator

public Player.UnitIterator(Player owner,
                           Player.UnitPredicate predicate)
Creates a new NextActiveUnitIterator.

Parameters:
owner - The Player that needs an iterator of it's units.
predicate - An object for deciding whether a Unit should be included in the Iterator or not.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<Unit>

next

public Unit next()
Specified by:
next in interface java.util.Iterator<Unit>

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<Unit>
Throws:
java.lang.UnsupportedOperationException - no matter what.