|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.gold.java.AboraHeaper
|
+--org.abora.gold.xpp.basic.Heaper
|
+--org.abora.gold.collection.tables.ScruTable
Please read class comment for ScruSet first.
Like Sets, Tables represent collections of Heapers, and provide protocol for storing,
retrieving, and iterating over the collection. However, Tables in addition provide an
organization for the Heapers collected together in the range of a Table: A Table can also
be seen as a collection of associations between keys and values. A particular Table
object has a particular domain coordinateSpace, and all keys in that Table are positions
in that coordinate space. For each position in a Table''s coordinate space there is at
most one value which it maps to. This value may be any arbitrary Heaper. The same Heaper
may appear as value for several keys.
When iterating over the contents of a Table with a Stepper, the normal elements enumerated
by the Stepper are values (i.e., range elements) of the Table. However,
ScruTable::stepper returns a TableStepper (a subclass of Stepper) which provides aditional
protocol of accessing the key corresponding to the current value. (see ScruTable::stepper
and TableStepper.)
| Field Summary | |
protected static Signal |
NotInTableSignal
|
protected static Signal |
WrongCoordSpaceSignal
|
| Fields inherited from class org.abora.gold.xpp.basic.Heaper |
AllBlasts, BecomeMap, GarbageCount, InGC, InitializedClasses, InitializingClasses, LastMemory, NextClientRequestNumber, NotOneElementSignal, PackageTable, PromiseNameTable, StringHashSBoxes |
| Fields inherited from class org.abora.gold.java.AboraHeaper |
ActiveClubs, CurrentAuthor, CurrentBertCanopyCache, CurrentBertCrum, CurrentChunk, CurrentGrandMap, CurrentKeyMaster, CurrentPacker, CurrentSensorCanopyCache, CurrentServer, CurrentSession, CurrentSessions, CurrentTrace, InitialEditClub, InitialOwner, InitialReadClub, InitialSponsor, InsideTransactionFlag |
| Constructor Summary | |
ScruTable()
|
|
| Method Summary | |
int |
actualHashForEqual()
See ScruTable::isEqual |
ImmuTable |
asImmuTable()
Return a side-effect-free snapshot of my current contents. See ScruSet::asImmuSet. |
MuTable |
asMuTable()
Return a side-effectable version of the same table. See ScruSet::asMuSet. |
void |
asOrderedCollection()
convert for use with Smalltalk MVC stuff |
ScruTable |
backfollowFrom(Heaper value)
Return the subTable with the domain of all positions whose values are equal to value. |
boolean |
contentsEqual(ScruTable other)
Returns whether the two ScruTables have exactly the same mapping from keys to values at the moment. |
int |
contentsHash()
Has the same relationship to contentsEqual that hashForEqual has to isEqual. I.e., if 'a->contentsEqual (b)', then 'a->contentsHash() == b->contentsHash()'. The same complex caveats apply as to the stability and portability of the hash values as apply for hashForEqual. |
CoordinateSpace |
coordinateSpace()
The kind of elements used to index into the table are Positions of this coordinate space. |
ScruTable |
copy()
A new one whose initial state is my current state, but that doesn't track changes. |
IntegerVar |
count()
Return the number of domain elements, which is to say, the number of associations. 'table->count()' should be equivalent to 'table->domain()->count()'. Used to say: 'Return the number of range elements'. |
XnRegion |
domain()
Return an XuRegion representing a snapshot of the current domain. 'table->domain()->hasMember(p)' iff 'table->fetch(p) !!= NULL'. |
void |
dox(BlockClosure aBlock)
|
ScruTable |
emptySize(IntegerVar size)
Return an empty table just like the current one. |
Heaper |
fetch(Position key)
Return the range element at the domain position key. |
Heaper |
get(Position key)
Return the range element at the domain position key. |
boolean |
includesIntKey(IntegerVar aKey)
Unboxed version. |
boolean |
includesKey(Position key)
includesKey is used to test for the presence of a key->value pair in the table. |
Heaper |
intFetch(IntegerVar key)
Unboxed version. |
Heaper |
intGet(IntegerVar key)
Unboxed version. |
boolean |
isEmpty()
Is there anything in the table? 'table->isEmpty()' iff 'table->domain()->isEmpty()'. |
boolean |
isEqual(Heaper other)
All MuTable subclasses have equality based on identity (now and forever equal. |
void |
printOn(java.io.PrintWriter stream)
|
void |
printOnWithSimpleSyntax(java.io.PrintWriter oo,
java.lang.String open,
java.lang.String sep,
java.lang.String close)
Print the contents of the table as |
void |
printOnWithSyntax(java.io.PrintWriter stream,
java.lang.String open,
java.lang.String map,
java.lang.String sep,
java.lang.String close)
Print the contents of the table as |
static void |
problems()
A ProblemList for all X++ BLASTs |
ImmuSet |
range()
A snapshot of the current range elements of the table collected together into an ImmuSet. |
XnRegion |
runAt(Position key)
Return the length of the run starting at position key. |
XnRegion |
runAtInt(IntegerVar key)
Unboxed version. |
TableStepper |
stepper()
implement default argument of NULL |
TableStepper |
stepper(OrderSpec order)
Return a TableStepper which will enumerate my key->value mappings. |
ScruTable |
subTable(XnRegion region)
Return a table which contains only the intersection of this table's domain and the domain specified by 'region'. table->subTable(r)->domain()->isEqual( table->domain()->intersect(r) ). It is unspecified whether the resulting table starts as a snapshot of a subset of me, after which we go our own ways; or whether the resulting table is a view onto a subset of me, such that changes to me are also visible to him. |
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. 'table->transformedBy(d)->fetch(p)' is equivalent to 'table->fetch(d->of(p))'. See ScruTable::subTable for caveats regarding whether we return a snapshot or a view. |
| Methods inherited from class org.abora.gold.java.AboraHeaper |
asOop, basicInspect, displayString, error, hack, halt, inspect, knownBug, mightNotImplement, REQUIRES, shouldImplement, shouldNotImplement, stubbleForSubclassResponsibility, thingToDo, willNotImplement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static Signal NotInTableSignal
protected static Signal WrongCoordSpaceSignal
| Constructor Detail |
public ScruTable()
| Method Detail |
public CoordinateSpace coordinateSpace()
public IntegerVar count()
public XnRegion domain()
public Heaper fetch(Position key)
public Heaper get(Position key)
public ImmuSet range()
public ScruTable subTable(XnRegion region)
public ScruTable transformedBy(Dsp dsp)
public int actualHashForEqual()
actualHashForEqual in class Heaperpublic boolean contentsEqual(ScruTable other)
public int contentsHash()
public boolean includesKey(Position key)
public boolean isEmpty()
public boolean isEqual(Heaper other)
isEqual in class Heaperpublic TableStepper stepper(OrderSpec order)
public Heaper theOne()
public ImmuTable asImmuTable()
public MuTable asMuTable()
public ScruTable backfollowFrom(Heaper value)
public void printOn(java.io.PrintWriter stream)
printOn in class Heaper
public void printOnWithSimpleSyntax(java.io.PrintWriter oo,
java.lang.String open,
java.lang.String sep,
java.lang.String close)
public void printOnWithSyntax(java.io.PrintWriter stream,
java.lang.String open,
java.lang.String map,
java.lang.String sep,
java.lang.String close)
public XnRegion runAt(Position key)
public ScruTable copy()
public ScruTable emptySize(IntegerVar size)
public boolean includesIntKey(IntegerVar aKey)
public Heaper intFetch(IntegerVar key)
public Heaper intGet(IntegerVar key)
public XnRegion runAtInt(IntegerVar key)
public TableStepper stepper()
public void asOrderedCollection()
public void dox(BlockClosure aBlock)
public static void problems()
Heaper
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||