physis.core.iterator
Interface DigitalOrganismIterator

All Known Implementing Classes:
Array2DDigitalOrganismIterator, ArrayDigitalOrganismIterator

public interface DigitalOrganismIterator

Iterator for digital organisms. It's a bit more efficient to use instead of the general Iterator, because the casting is expensive.


Method Summary
 DigitalOrganism getFirst()
          Returns the first organism.
 DigitalOrganism getLast()
          Returns the last organism.
 boolean hasNext()
          Returns true if there is at least one organism more.
 boolean hasPrevious()
          Returns true if there is at least one organism before the current.
 DigitalOrganism next()
          Returns the next DigitalOrganism from this collection.
 DigitalOrganism previous()
          Returns the previous DigitalOrganism from this collection.
 DigitalOrganism randomly()
          Returns one organism from the underlying collection.
 void reset()
          Resets the iterator: the enumerating of organisms can be repeated from the begining..
 

Method Detail

hasNext

public boolean hasNext()
Returns true if there is at least one organism more.

next

public DigitalOrganism next()
Returns the next DigitalOrganism from this collection.

hasPrevious

public boolean hasPrevious()
Returns true if there is at least one organism before the current.

previous

public DigitalOrganism previous()
Returns the previous DigitalOrganism from this collection.

getFirst

public DigitalOrganism getFirst()
Returns the first organism.

getLast

public DigitalOrganism getLast()
Returns the last organism.

randomly

public DigitalOrganism randomly()
Returns one organism from the underlying collection. It doesn't change the actual enumeration.

reset

public void reset()
Resets the iterator: the enumerating of organisms can be repeated from the begining..