Index - All Packages - All Categories - All Classes

Class 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.

Package: Udanax-Gold
All Superclasses: Object Heaper Stepper
Immediate Subclasses: ArrayStepper BucketArrayStepper EditionStepper GrandHashTableStepper GrantStepper IntegerTableStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper
Protocols: Object
Categories: Xanadu-Collection-Steppers

Class Methods

ascending: 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. This is an unchecked an uncheckable precondition on my clients.

Overridden by: PtrArrayStepper class

descending: 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. This is an unchecked an uncheckable precondition on my clients.

Overridden by: PtrArrayStepper class

infostProtocol



Overrides: Stepper class

Instance Methods

copy



Overrides: Stepper
Overridden by: ArrayStepper AscendingArrayStepper BucketArrayStepper EditionStepper GrandHashTableStepper GrantStepper IntegerTableStepper ITAscendingStepper ITDescendingStepper ITGenericStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper

fetch



Overrides: Stepper
Overridden by: ArrayStepper AscendingArrayStepper BucketArrayStepper EditionStepper GrandHashTableStepper GrantStepper IntegerTableStepper ITAscendingStepper ITDescendingStepper ITGenericStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper

forIndices: fn


forKeyValues: fn


forPositions: fn


forPromisedPairs: aBlock


hasValue



Overrides: Stepper
Overridden by: ArrayStepper AscendingArrayStepper BucketArrayStepper EditionStepper GrandHashTableStepper GrantStepper IntegerTableStepper ITAscendingStepper ITDescendingStepper ITGenericStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper

index

Unboxed version of TableStepper::key. See class comment in XuInteger.

Overridden by: ArrayStepper BucketArrayStepper ITAscendingStepper ITDescendingStepper ITGenericStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper

key

A TableStepper actually enumerates the associations of a table. Through the normal Stepper protocol, it makes available the range element of the current association. Through this additional protocol, it make accessible the key of the current association. This message returns the same object as TwoStepper::other, the only difference being the static knowledge that it's a Position.

position

A TableStepper actually enumerates the associations of a table. Through the normal Stepper protocol, it makes available the range element of the current association. Through this additional protocol, it make accessible the key of the current association. This message returns the same object as TwoStepper::other, the only difference being the static knowledge that it's a Position.

Overridden by: ArrayStepper BucketArrayStepper EditionStepper GrandHashTableStepper GrantStepper IntegerTableStepper ITAscendingStepper ITDescendingStepper ITGenericStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper

step



Overrides: Stepper
Overridden by: ArrayStepper AscendingArrayStepper BucketArrayStepper EditionStepper GrandHashTableStepper GrantStepper IntegerTableStepper ITAscendingStepper ITDescendingStepper ITGenericStepper OffsetArrayStepper OffsetScruTableStepper PtrArrayStepper

stepManyPairs


stepManyPairs: 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. You should check whether the stepper is atEnd, since it can stop before the number you give it because of some internal limit or grouping issue.


Index - All Packages - All Categories - All Classes