etomica.atom.iterator
Class Atomset3IteratorIndexList

java.lang.Object
  extended by etomica.atom.iterator.Atomset3IteratorIndexList
All Implemented Interfaces:
AtomLeafsetIterator, AtomsetIterator, AtomsetIteratorBasisDependent, AtomsetIteratorTargetable

public class Atomset3IteratorIndexList
extends Object
implements AtomsetIteratorBasisDependent

Atomset Iterator that iterates over set-of-three atoms


Constructor Summary
Atomset3IteratorIndexList(int[][] index)
          Constructs iterator without defining set of atoms.
 
Method Summary
 int basisSize()
          Indicates the size of the basis needed to set the iterator.
protected  boolean hasNext()
          Returns true if three non-null atoms have set and a call to reset() has been performed, without any subsequent calls to next() or nextPair().
 boolean haveTarget(IAtom a)
          Returns true if the iterator with its current basis would return an iterate for the given target.
 int nBody()
          Returns 3, indicating that this is a set of three iterator.
 IAtomList next()
          Same as nextSet().
 AtomsetArray nextSet()
          Returns the iterator's pair and unsets iterator.
 void reset()
          Resets iterator to a state where hasNext is true, if atoms in pair are not null.
 void setBasis(IMoleculeList parent)
          Identifies the atoms that form the basis for iteration, such that the childList atoms of those given will form the iterates.
 void setTarget(IAtom a)
           
 int size()
          The number of iterates returned by this iterator in its current state.
 void unset()
          Sets iterator to a state where hasNext() returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Atomset3IteratorIndexList

public Atomset3IteratorIndexList(int[][] index)
Constructs iterator without defining set of atoms.

Method Detail

basisSize

public int basisSize()
Description copied from interface: AtomsetIteratorBasisDependent
Indicates the size of the basis needed to set the iterator. The length of the array given to setBasis should be this value.

Specified by:
basisSize in interface AtomsetIteratorBasisDependent
Returns:
the size of the basis for this iterator.

haveTarget

public boolean haveTarget(IAtom a)
Description copied from interface: AtomsetIteratorBasisDependent
Returns true if the iterator with its current basis would return an iterate for the given target.

Specified by:
haveTarget in interface AtomsetIteratorBasisDependent

setTarget

public void setTarget(IAtom a)
Specified by:
setTarget in interface AtomsetIteratorTargetable

setBasis

public void setBasis(IMoleculeList parent)
Description copied from interface: AtomsetIteratorBasisDependent
Identifies the atoms that form the basis for iteration, such that the childList atoms of those given will form the iterates.

Specified by:
setBasis in interface AtomsetIteratorBasisDependent
Parameters:
parent - The basis atoms; a null basis will condition the iterator to give no iterates until a valid basis is specified via another call to this method.

size

public int size()
Description copied from interface: AtomsetIterator
The number of iterates returned by this iterator in its current state.

Specified by:
size in interface AtomsetIterator

hasNext

protected boolean hasNext()
Returns true if three non-null atoms have set and a call to reset() has been performed, without any subsequent calls to next() or nextPair().


unset

public void unset()
Sets iterator to a state where hasNext() returns false.

Specified by:
unset in interface AtomsetIterator

reset

public void reset()
Resets iterator to a state where hasNext is true, if atoms in pair are not null.

Specified by:
reset in interface AtomsetIterator

nextSet

public AtomsetArray nextSet()
Returns the iterator's pair and unsets iterator.


next

public IAtomList next()
Same as nextSet().

Specified by:
next in interface AtomLeafsetIterator

nBody

public final int nBody()
Returns 3, indicating that this is a set of three iterator.

Specified by:
nBody in interface AtomsetIterator
Returns: