|
||||||||
| 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.tables.ScruTable
|
+--org.abora.white.collection.tables.MuTable
|
+--org.abora.white.collection.tables.IntegerTable
The IntegerTable class is used for tables that have arbitrary XuInteger keys in their domain. Since ScruTable & MuTable already provide all the unboxed versions of the table protocol, there is little need for this class to be a type. However, this class does provide a bit of extra protocol convenience: highestIndex & lowestIndex. Unless these are retired, we cannot retire this class from type status.
Note that there may be tables with XuInteger keys (i.e., IntegerSpace domains) which are not kinds of IntegerTables. In particular it is perfectly sensible to create a HashTable with XuInteger keys when the domain region is likely to be sparse.
| Constructor Summary | |
protected |
IntegerTable()
Create a new table with an unspecified number of initial domain positions. |
protected |
IntegerTable(Rcvr rcvr)
|
| Method Summary | |
void |
atIntIntroduce(IntegerValue key,
Heaper value)
Unboxed version. |
void |
atIntReplace(IntegerValue key,
Heaper value)
Unboxed version. |
void |
atIntroduce(Position key,
Heaper value)
Associate key with value unless key is already associated with another value. |
abstract Heaper |
atIntStore(IntegerValue key,
Heaper value)
Unboxed version. |
void |
atReplace(Position key,
Heaper value)
Associate key with value only if key is already associated with a value. |
Heaper |
atStore(Position key,
Heaper value)
Associate value with key, whether or not there is a previous association. |
CoordinateSpace |
coordinateSpace()
The kind of elements used to index into the table are Positions of this coordinate space. |
abstract ScruTable |
copy()
A new one whose initial state is my current state, but that doesn't track changes. |
abstract IntegerValue |
count()
Return the number of domain elements, which is to say, the number of associations. |
abstract XnRegion |
domain()
Return an XuRegion representing a snapshot of the current domain. |
abstract ScruTable |
emptySize(IntegerValue size)
Return an empty table just like the current one. |
Heaper |
fetch(Position key)
Return the range element at the domain position key. |
abstract IntegerValue |
highestIndex()
Given that the table is non-empty, 'intTab->highestIndex()' is equivalent to 'CAST(IntegerRegion,intTab->domain())->upperBound() -1'. |
abstract boolean |
includesIntKey(IntegerValue aKey)
Unboxed version. |
boolean |
includesKey(Position aKey)
includesKey is used to test for the presence of a key->value pair in the table. |
abstract Heaper |
intFetch(IntegerValue key)
Unboxed version. |
void |
intRemove(IntegerValue anIdx)
Unboxed version. |
abstract boolean |
intWipe(IntegerValue anIdx)
Unboxed version. |
abstract boolean |
isEmpty()
Is there anything in the table? 'table->isEmpty()' iff 'table->domain()->isEmpty()'. |
abstract IntegerValue |
lowestIndex()
Given that the table is non-empty, 'intTab->lowestIndex()' is equivalent to 'CAST(IntegerRegion,intTab->domain())->lowerBound()'. |
static IntegerTable |
make()
A new empty IntegerTable |
static IntegerTable |
make(IntegerRegion reg)
Hint that the domain of the new table will eventually be (or at least resemble) 'reg'. |
static IntegerTable |
make(IntegerValue someSize)
A new empty IntegerTable. |
static IntegerTable |
make(IntegerValue fromIdx,
IntegerValue toIdx)
Hint that the domain's lowerBound (inclusive) will eventually be 'fromIdx', and the domain's upperBound (exclusive) will eventually be 'toIdx'. |
abstract ScruTable |
offsetSubTableBetween(IntegerValue startIndex,
IntegerValue stopIndex,
IntegerValue firstIndex)
Return a table which contains the elements from start to stop, starting at firstIndex. |
void |
remove(Position aPos)
Remove a key->value association from the table. |
XnRegion |
runAt(Position key)
Return the length of the run starting at position key. |
abstract XnRegion |
runAtInt(IntegerValue key)
Unboxed version. |
abstract TableStepper |
stepper(OrderSpec order)
Return a TableStepper which will enumerate my key->value mappings. |
abstract ScruTable |
subTable(XnRegion reg)
Return a table which contains only the intersection of this table's domain and the domain specified by 'region'. |
abstract ScruTable |
subTableBetween(IntegerValue startIndex,
IntegerValue stopIndex)
Hack for C++ overloading problem |
boolean |
wipe(Position anIdx)
Remove a key->value association from the table. |
| Methods inherited from class org.abora.white.collection.tables.MuTable |
actualHashForEqual, asImmuTable, asMuTable, introduceAll, introduceAll, introduceAll, isEqual, make, make, problems, removeAll, replaceAll, replaceAll, replaceAll, sendSelfTo, storeAll, storeAll, storeAll, wipeAll |
| Methods inherited from class org.abora.white.collection.tables.ScruTable |
backfollowFrom, contentsEqual, contentsHash, get, intGet, printOn, printOnWithSimpleSyntax, printOnWithSyntax, range, stepper, theOne, transformedBy |
| Methods inherited from class org.abora.white.xpp.basic.Heaper |
destroy, destruct, equals, hashForEqual, printContentsOn, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected IntegerTable()
protected IntegerTable(Rcvr rcvr)
| Method Detail |
public void atIntIntroduce(IntegerValue key,
Heaper value)
MuTable
atIntIntroduce in class MuTable
public void atIntReplace(IntegerValue key,
Heaper value)
MuTable
atIntReplace in class MuTable
public abstract Heaper atIntStore(IntegerValue key,
Heaper value)
MuTable
atIntStore in class MuTablepublic CoordinateSpace coordinateSpace()
ScruTable
coordinateSpace in class MuTablepublic abstract IntegerValue count()
ScruTable
count in class MuTablepublic abstract XnRegion domain()
ScruTable
domain in class MuTablepublic abstract IntegerValue highestIndex()
public abstract Heaper intFetch(IntegerValue key)
ScruTable
intFetch in class MuTablepublic void intRemove(IntegerValue anIdx)
MuTable
intRemove in class MuTablepublic abstract boolean intWipe(IntegerValue anIdx)
MuTable
intWipe in class MuTablepublic abstract IntegerValue lowestIndex()
public abstract ScruTable subTable(XnRegion reg)
ScruTable
subTable in class MuTable
public void atIntroduce(Position key,
Heaper value)
MuTable
atIntroduce in class MuTable
public void atReplace(Position key,
Heaper value)
MuTable
atReplace in class MuTable
public Heaper atStore(Position key,
Heaper value)
MuTable
atStore in class MuTablepublic Heaper fetch(Position key)
ScruTable
fetch in class MuTablepublic boolean includesKey(Position aKey)
ScruTable
includesKey in class MuTablepublic void remove(Position aPos)
MuTable
remove in class MuTablepublic XnRegion runAt(Position key)
ScruTable
runAt in class MuTablepublic boolean wipe(Position anIdx)
MuTable
wipe in class MuTablepublic abstract boolean includesIntKey(IntegerValue aKey)
ScruTable
includesIntKey in class MuTablepublic abstract boolean isEmpty()
ScruTable
isEmpty in class MuTablepublic abstract TableStepper stepper(OrderSpec order)
ScruTable
stepper in class MuTablepublic abstract XnRegion runAtInt(IntegerValue key)
ScruTable
runAtInt in class MuTablepublic abstract ScruTable copy()
ScruTable
copy in class MuTablepublic abstract ScruTable emptySize(IntegerValue size)
ScruTable
emptySize in class MuTable
public abstract ScruTable offsetSubTableBetween(IntegerValue startIndex,
IntegerValue stopIndex,
IntegerValue firstIndex)
public abstract ScruTable subTableBetween(IntegerValue startIndex,
IntegerValue stopIndex)
public static IntegerTable make()
public static IntegerTable make(IntegerValue someSize)
public static IntegerTable make(IntegerValue fromIdx,
IntegerValue toIdx)
public static IntegerTable make(IntegerRegion reg)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||