|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.atom.iterator.ApiInnerVariable
public class ApiInnerVariable
Pair iterator synthesized from two atom iterators, such that the inner-loop iteration depends on the outer-loop atom. Pairs are formed from the atoms yielded by the two atom iterators. The inner-loop iterator must implement AtomIteratorAtomDependent, and its set(Atom) method will be invoked with the current outer-loop atom at the start of each inner-loop iteration. All pairs returned by iterator are the same Atom[] instance, and differ only in the Atom instances held by it.
Iterator can be condition to put the atoms in either order in the AtomPair that it returns. Thus the inner-loop Atom may be atom0 of the returned AtomPair, or it may be atom1. This behavior is set at construction, and cannot be changed afterwards. Default behavior has outer loop atoms as atom0, and inner loop atoms as atom1.
| Field Summary | |
|---|---|
protected AtomIteratorAtomDependent |
aiInner
The iterators used to generate the sets of atoms. |
protected AtomIterator |
aiOuter
|
protected boolean |
doSwap
|
protected AtomPair |
pair
|
| Constructor Summary | |
|---|---|
ApiInnerVariable(AtomIterator aiOuter,
AtomIteratorAtomDependent aiInner)
Construct a pair iterator using the given atom iterators. |
|
ApiInnerVariable(AtomIterator aiOuter,
AtomIteratorAtomDependent aiInner,
boolean doSwap)
Construct a pair iterator using the given atom iterators, indicating whether the atoms ordering in the AtomPair should be swapped from the default behavior. |
|
| Method Summary | |
|---|---|
AtomIterator |
getInnerIterator()
Accessor method for the inner-loop atom iterator. |
AtomIterator |
getOuterIterator()
Accessor method for the outer-loop atom iterator. |
int |
nBody()
Returns the number of atoms given in each iterate, i.e., the size of the atom array returned with each call to next(). |
IAtomList |
next()
Returns the next pair of atoms. |
void |
reset()
Resets the iterator, so that it is ready to go through all of its pairs. |
int |
size()
Returns the number of pairs given by this iterator. |
void |
unset()
Sets the iterator such that hasNext is false. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final AtomPair pair
protected final AtomIteratorAtomDependent aiInner
protected final AtomIterator aiOuter
protected final boolean doSwap
| Constructor Detail |
|---|
public ApiInnerVariable(AtomIterator aiOuter,
AtomIteratorAtomDependent aiInner)
public ApiInnerVariable(AtomIterator aiOuter,
AtomIteratorAtomDependent aiInner,
boolean doSwap)
aiOuter - outer-loop iteratoraiInner - inner-loop iteratordoSwap - if false (default), outer-loop atoms are given in atom0, and
inner loop in atom1; if true outer-loop atoms are given in
atom1, and inner loop in atom0| Method Detail |
|---|
public AtomIterator getOuterIterator()
public AtomIterator getInnerIterator()
public void unset()
unset in interface AtomsetIteratorpublic int size()
size in interface AtomsetIteratorpublic void reset()
reset in interface AtomsetIteratorpublic IAtomList next()
next in interface AtomLeafsetIteratorpublic final int nBody()
AtomsetIterator
nBody in interface AtomsetIterator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||