etomica.atom.iterator
Class AtomIteratorArrayList

java.lang.Object
  extended by etomica.atom.iterator.AtomIteratorArrayListSimple
      extended by etomica.atom.iterator.AtomIteratorArrayList
All Implemented Interfaces:
AtomIterator, AtomIteratorAtomDependent, AtomLeafsetIterator, AtomsetIterator, Serializable

public class AtomIteratorArrayList
extends AtomIteratorArrayListSimple
implements AtomIteratorAtomDependent

An atom iterator of the elements from an AtomArrayList (in proper sequence). Iterator will fail if element are added to or removed from list while iteration is proceeding.

See Also:
Serialized Form

Field Summary
protected  boolean upListNow
           
 
Fields inherited from class etomica.atom.iterator.AtomIteratorArrayListSimple
atomSetSinglet, cursor, list
 
Constructor Summary
AtomIteratorArrayList(IteratorDirective.Direction direction)
          Constructs new iterator with an empty list.
AtomIteratorArrayList(IteratorDirective.Direction direction, int numToSkip)
          Constructs new iterator set to iterate given list (upon reset).
AtomIteratorArrayList(IteratorDirective.Direction direction, int numToSkip, AtomToIndex atomToIndex, AtomToAtomLeafList atomToAtomSet)
           
 
Method Summary
 IAtom nextAtom()
          Returns the next iterate and advances the iterator.
 void reset()
          Puts iterator in state ready to begin iteration.
 void setAtom(IAtom atom)
          Sets the first atom for iteration.
 int size()
          Returns the number of iterates that would be given by this iterator if reset with the current list.
 void unset()
          Puts iterator in state in which hasNext is false.
 
Methods inherited from class etomica.atom.iterator.AtomIteratorArrayListSimple
nBody, next, setList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface etomica.atom.iterator.AtomLeafsetIterator
next
 
Methods inherited from interface etomica.atom.iterator.AtomsetIterator
nBody
 

Field Detail

upListNow

protected final boolean upListNow
Constructor Detail

AtomIteratorArrayList

public AtomIteratorArrayList(IteratorDirective.Direction direction)
Constructs new iterator with an empty list.


AtomIteratorArrayList

public AtomIteratorArrayList(IteratorDirective.Direction direction,
                             int numToSkip)
Constructs new iterator set to iterate given list (upon reset).


AtomIteratorArrayList

public AtomIteratorArrayList(IteratorDirective.Direction direction,
                             int numToSkip,
                             AtomToIndex atomToIndex,
                             AtomToAtomLeafList atomToAtomSet)
Method Detail

nextAtom

public IAtom nextAtom()
Returns the next iterate and advances the iterator.

Specified by:
nextAtom in interface AtomIterator
Overrides:
nextAtom in class AtomIteratorArrayListSimple

size

public int size()
Returns the number of iterates that would be given by this iterator if reset with the current list.

Specified by:
size in interface AtomsetIterator
Overrides:
size in class AtomIteratorArrayListSimple

reset

public void reset()
Puts iterator in state ready to begin iteration.

Specified by:
reset in interface AtomsetIterator
Overrides:
reset in class AtomIteratorArrayListSimple

unset

public void unset()
Description copied from class: AtomIteratorArrayListSimple
Puts iterator in state in which hasNext is false.

Specified by:
unset in interface AtomsetIterator
Overrides:
unset in class AtomIteratorArrayListSimple

setAtom

public void setAtom(IAtom atom)
Sets the first atom for iteration. Iteration proceeds from this atom up and/or down the list, depending on how iterator was configured at construction.

Specified by:
setAtom in interface AtomIteratorAtomDependent