etomica.nbr.cell
Class AtomIteratorCell

java.lang.Object
  extended by etomica.nbr.cell.AtomIteratorCell
All Implemented Interfaces:
AtomIterator, AtomLeafsetIterator, AtomsetIterator, Serializable

public class AtomIteratorCell
extends Object
implements AtomIterator, Serializable

Returns occupants of all cells as iterates.

See Also:
Serialized Form

Field Summary
protected  AtomSetSinglet atomSetSinglet
           
 
Constructor Summary
AtomIteratorCell(int D, BoxAgentManager agentManager)
          Constructor makes iterator that must have box specified and then be reset() before iteration.
 
Method Summary
 boolean hasNext()
           
 int nBody()
          Returns 1, indicating that this is an atom iterator.
 IAtomList next()
          Returns the next AtomSet iterate, or null if hasNext() is false.
 IAtom nextAtom()
          Returns the next atom in the iteration sequence, or null if hasNext() is false.
 void reset()
          Resets the iterator to loop through its iterates again.
 void setBox(IBox box)
           
 int size()
          Returns the number of atoms the iterator will return if reset and iterated in its present state.
 void unset()
          Puts iterator in a state in which hasNext() returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

atomSetSinglet

protected final AtomSetSinglet atomSetSinglet
Constructor Detail

AtomIteratorCell

public AtomIteratorCell(int D,
                        BoxAgentManager agentManager)
Constructor makes iterator that must have box specified and then be reset() before iteration.

Parameters:
D - the dimension of the space of the simulation (used to construct cell iterators)
Method Detail

setBox

public void setBox(IBox box)

size

public int size()
Returns the number of atoms the iterator will return if reset and iterated in its present state.

Specified by:
size in interface AtomsetIterator

hasNext

public boolean hasNext()

next

public final IAtomList next()
Description copied from interface: AtomLeafsetIterator
Returns the next AtomSet iterate, or null if hasNext() is false.

Specified by:
next in interface AtomLeafsetIterator

nextAtom

public IAtom nextAtom()
Description copied from interface: AtomIterator
Returns the next atom in the iteration sequence, or null if hasNext() is false.

Specified by:
nextAtom in interface AtomIterator

unset

public void unset()
Description copied from interface: AtomsetIterator
Puts iterator in a state in which hasNext() returns false.

Specified by:
unset in interface AtomsetIterator

nBody

public int nBody()
Returns 1, indicating that this is an atom iterator.

Specified by:
nBody in interface AtomsetIterator
Returns:

reset

public void reset()
Description copied from interface: AtomsetIterator
Resets the iterator to loop through its iterates again.

Specified by:
reset in interface AtomsetIterator