|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.white.xpp.basic.Heaper
|
+--org.abora.white.collection.steppers.Stepper
|
+--org.abora.white.collection.steppers.TableStepper
For enumerating the key->value associations of a table. A typical use (for a table whose range elements were all Foos) might be: SPTR(TableStepper) stomp = table->stepper(); FOR_EACH(Foo,f,stomp, { doSomethingWith(stomp->key(), z); }); Each iteration of the loop would correspond to an association of the table (snapshotted at the time "->stepper()" was sent). For each association, "f" (a pointer to Foo) points at the range element, while "stomp->key()" provides the domain element. See ScruTable::stepper.
| Field Summary |
| Fields inherited from class org.abora.white.collection.steppers.Stepper |
TheEmptyStepper |
| Constructor Summary | |
TableStepper()
|
|
TableStepper(Rcvr rcvr)
|
|
| Method Summary | |
static TableStepper |
ascending(PtrArray array)
Note: this being a low level operation, and there being no lightweight form of immutable or lazily copied PtrArray, it is my caller's responsibility to pass me a PtrArray which will in fact not be changed during the life of this stepper. |
abstract Stepper |
copy()
Return a new stepper which steps independently of me, but whose current value is the same as mine, and which must produce a future history of values which satisfies the same obligation that my contract obligates me to produce now. |
static TableStepper |
descending(PtrArray array)
Note: this being a low level operation, and there being no lightweight form of immutable or lazily copied PtrArray, it is my caller's responsibility to pass me a PtrArray which will in fact not be changed during the life of this stepper. |
abstract Heaper |
fetch()
If I am exhausted (i.e., if (!! this->hasValue())), then return NULL. |
abstract boolean |
hasValue()
Iff I have a current value (i.e. |
IntegerValue |
index()
Unboxed version of TableStepper::key. |
static void |
info()
{Position CLIENT} position {PrimArray CLIENT} stepManyPairs: count {Int32 default: -1} |
Position |
key()
A TableStepper actually enumerates the associations of a table. |
abstract Position |
position()
A TableStepper actually enumerates the associations of a table. |
abstract void |
step()
Essential. |
PrimArray |
stepManyPairs()
|
PrimArray |
stepManyPairs(int count)
An array of the remaining elements in alternating positions in the array [k1, v1, k2, v2, k3, v3, ...] Returns an array of up to count * 2 elements (or some arbitrary number if count is negative), and steps the stepper the corresponding number of times. |
| Methods inherited from class org.abora.white.collection.steppers.Stepper |
actualHashForEqual, atEnd, emptyStepper, get, isEqual, itemStepper, stepMany, stepMany, theOne |
| Methods inherited from class org.abora.white.xpp.basic.Heaper |
destroy, destruct, equals, hashForEqual, printContentsOn, printOn, sendSelfTo, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TableStepper()
public TableStepper(Rcvr rcvr)
| Method Detail |
public Position key()
public IntegerValue index()
public abstract Position position()
public abstract Stepper copy()
Stepper
copy in class Stepperpublic abstract Heaper fetch()
Stepper
fetch in class Stepperpublic abstract boolean hasValue()
Stepper
hasValue in class Stepperpublic abstract void step()
Stepper
step in class Stepperpublic PrimArray stepManyPairs(int count)
public PrimArray stepManyPairs()
public static void info()
public static TableStepper ascending(PtrArray array)
public static TableStepper descending(PtrArray array)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||