|
||||||||
| 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
|
+--org.abora.white.collection.tables.MuArray
The class XuArray is intended to model zero-based arrays with integer keys (indices). This makes them like the array primitive in C and C++. There is an additional constraint, which is they are to have simple domains. Therefore they should not be constructed with non-contiguous sections. This is not currently enforced. Given that it is enforced, an XuArray with count N would have as its domain exactly the integers from 0 to N-1.
There is some controversy over whether XuArray should be a type and enforce this contraint (by BLASTing if an attempt is made to violate the constraint), or whether XuArray is just a specialized implementation for when an IntegerTable happens to meet this constraint; in which case it should "become" a more general implementation when an attempt is made to violate the constraint (see "Type Safe Become"). In the latter case, XuArray will probably be made a private class as well. Please give us your opinion. XuArray provides no additional protocol.
| Constructor Summary | |
protected |
MuArray()
|
protected |
MuArray(Rcvr rcvr)
|
| Method Summary | |
static MuArray |
array()
A new empty XnArray |
static MuArray |
array(Heaper obj0)
A new XnArray initialized with a single element, 'obj0', stored at index 0. |
static MuArray |
array(Heaper obj0,
Heaper obj1)
A new XnArray initialized with a two elements stored at indicies 0 and 1. |
static MuArray |
array(Heaper obj0,
Heaper obj1,
Heaper obj2)
A new XuArray initialized with a three elements stored at indicies 0, 1, and 2. |
static MuArray |
array(Heaper obj0,
Heaper obj1,
Heaper obj2,
Heaper obj3)
A new XuArray initialized with a four elements stored at indicies 0 through 3. |
static TableAccumulator |
arrayAccumulator()
Returns an Accumulator which will produce an XuArray of the elements accumulated into it in order of accumulation. |
static TableAccumulator |
arrayAccumulator(MuArray onArray)
An accumulator which will accumulate by appending elements onto the end of 'onArray'. |
abstract Heaper |
atIntStore(IntegerValue key,
Heaper value)
Unboxed version. |
Heaper |
atStore(Position key,
Heaper value)
Associate value with key, whether or not there is a previous association. |
abstract 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'. |
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. |
abstract boolean |
intWipe(IntegerValue anIdx)
Unboxed version. |
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(IntegerValue someSize)
'someSize' is a hint about how big we should expect the array to need to grow. |
static ScruTable |
offsetScruArray(MuArray array,
Dsp dsp)
The resulting ScruTable is a view onto 'array'. |
ScruTable |
offsetSubTableBetween(IntegerValue startIndex,
IntegerValue stopIndex,
IntegerValue firstIndex)
Return a table which contains the elements from start to stop, starting at firstIndex. |
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 stepper on this table. |
abstract ScruTable |
subTable(XnRegion region)
Return a table which contains only the intersection of this table's domain and the domain specified by 'region'. |
abstract ScruTable |
subTableBetween(IntegerValue startLoc,
IntegerValue endLoc)
Hack for C++ overloading problem |
Heaper |
theOne()
Iff I contain exactly one range element, return it. |
ScruTable |
transformedBy(Dsp dsp)
Return a ScruTable with the domain of the receiver transformed by the Dsp. |
boolean |
wipe(Position key)
Remove a key->value association from the table. |
void |
wipeAll(XnRegion region)
I 'wipe' from myself all associations whose key is in 'region'. |
| Methods inherited from class org.abora.white.collection.tables.IntegerTable |
atIntIntroduce, atIntReplace, atIntroduce, atReplace, intRemove, make, make, make, remove |
| 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 |
| Methods inherited from class org.abora.white.collection.tables.ScruTable |
backfollowFrom, contentsEqual, contentsHash, get, intGet, printOn, printOnWithSimpleSyntax, printOnWithSyntax, range, stepper |
| 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 MuArray()
protected MuArray(Rcvr rcvr)
| Method Detail |
public static MuArray array()
public static MuArray array(Heaper obj0)
public static MuArray array(Heaper obj0,
Heaper obj1)
public static MuArray array(Heaper obj0,
Heaper obj1,
Heaper obj2)
public static MuArray array(Heaper obj0,
Heaper obj1,
Heaper obj2,
Heaper obj3)
public static TableAccumulator arrayAccumulator()
public static TableAccumulator arrayAccumulator(MuArray onArray)
public static IntegerTable make(IntegerValue someSize)
public static ScruTable offsetScruArray(MuArray array,
Dsp dsp)
public abstract Heaper atIntStore(IntegerValue key,
Heaper value)
MuTable
atIntStore in class IntegerTablepublic abstract CoordinateSpace coordinateSpace()
ScruTable
coordinateSpace in class IntegerTablepublic abstract IntegerValue count()
ScruTable
count in class IntegerTablepublic abstract XnRegion domain()
ScruTable
domain in class IntegerTablepublic abstract IntegerValue highestIndex()
IntegerTable
highestIndex in class IntegerTablepublic abstract Heaper intFetch(IntegerValue key)
ScruTable
intFetch in class IntegerTablepublic abstract boolean intWipe(IntegerValue anIdx)
MuTable
intWipe in class IntegerTablepublic abstract IntegerValue lowestIndex()
IntegerTable
lowestIndex in class IntegerTable
public ScruTable offsetSubTableBetween(IntegerValue startIndex,
IntegerValue stopIndex,
IntegerValue firstIndex)
offsetSubTableBetween in class IntegerTablepublic abstract ScruTable subTable(XnRegion region)
ScruTable
subTable in class IntegerTable
public abstract ScruTable subTableBetween(IntegerValue startLoc,
IntegerValue endLoc)
IntegerTable
subTableBetween in class IntegerTablepublic ScruTable transformedBy(Dsp dsp)
ScruTable
transformedBy in class ScruTablepublic abstract ScruTable copy()
ScruTable
copy in class IntegerTablepublic abstract ScruTable emptySize(IntegerValue size)
ScruTable
emptySize in class IntegerTablepublic boolean includesIntKey(IntegerValue aKey)
ScruTable
includesIntKey in class IntegerTablepublic boolean isEmpty()
ScruTable
isEmpty in class IntegerTablepublic abstract XnRegion runAtInt(IntegerValue key)
ScruTable
runAtInt in class IntegerTablepublic abstract TableStepper stepper(OrderSpec order)
stepper in class IntegerTablepublic Heaper theOne()
ScruTable
theOne in class ScruTablepublic void wipeAll(XnRegion region)
wipeAll in class MuTable
public Heaper atStore(Position key,
Heaper value)
MuTable
atStore in class IntegerTablepublic Heaper fetch(Position key)
ScruTable
fetch in class IntegerTablepublic boolean includesKey(Position aKey)
ScruTable
includesKey in class IntegerTablepublic XnRegion runAt(Position key)
ScruTable
runAt in class IntegerTablepublic boolean wipe(Position key)
MuTable
wipe in class IntegerTable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||