AtomLeafsetIterator
, AtomsetIterator
, java.io.Serializable
public class ApiInnerVariable extends java.lang.Object implements AtomLeafsetIterator, java.io.Serializable
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.
Modifier and Type | Field | Description |
---|---|---|
protected AtomIteratorAtomDependent |
aiInner |
The iterators used to generate the sets of atoms.
|
protected AtomIterator |
aiOuter |
|
protected boolean |
doSwap |
|
protected AtomPair |
pair |
Constructor | Description |
---|---|
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.
|
Modifier and Type | Method | Description |
---|---|---|
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.
|
protected final AtomPair pair
protected final AtomIteratorAtomDependent aiInner
protected final AtomIterator aiOuter
protected final boolean doSwap
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 atom0public AtomIterator getOuterIterator()
public AtomIterator getInnerIterator()
public void unset()
unset
in interface AtomsetIterator
public int size()
size
in interface AtomsetIterator
public void reset()
reset
in interface AtomsetIterator
public IAtomList next()
next
in interface AtomLeafsetIterator
public final int nBody()
AtomsetIterator
nBody
in interface AtomsetIterator