org.abora.gold.collection.tables
Class ActualIntegerTable

java.lang.Object
  |
  +--org.abora.gold.java.AboraHeaper
        |
        +--org.abora.gold.xpp.basic.Heaper
              |
              +--org.abora.gold.collection.tables.ScruTable
                    |
                    +--org.abora.gold.collection.tables.MuTable
                          |
                          +--org.abora.gold.collection.tables.IntegerTable
                                |
                                +--org.abora.gold.collection.tables.OberIntegerTable
                                      |
                                      +--org.abora.gold.collection.tables.ActualIntegerTable

public class ActualIntegerTable
extends OberIntegerTable

The IntegerTable class is intended to provide an integer indexed
table which is not constrained to be zero based.


Field Summary
protected  boolean domainIsSimple
           
protected  int elemCount
           
protected  PtrArray elements
           
protected  int firstElem
           
protected  int lastElem
           
protected  IntegerVar start
           
protected  int tally
           
 
Fields inherited from class org.abora.gold.collection.tables.OberIntegerTable
myNextCOW
 
Fields inherited from class org.abora.gold.collection.tables.MuTable
AlreadyInTableSignal, NotInDomainSignal, NullInsertionSignal
 
Fields inherited from class org.abora.gold.collection.tables.ScruTable
NotInTableSignal, 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
ActualIntegerTable()
          The optional argument just hints at the number of elements
to eventually be added.
ActualIntegerTable(IntegerVar size)
          The optional argument just hints at the number of elements
to eventually be added.
ActualIntegerTable(IntegerVar begin, IntegerVar end)
          Hint at the domain to be accessed (inclusive, exclusive).
ActualIntegerTable(PtrArray array, IntegerVar begin, int count, int first, int last, int aTally, boolean simple)
           
ActualIntegerTable(Rcvr receiver)
           
 
Method Summary
 Heaper atIntStore(IntegerVar index, Heaper value)
          Unboxed version.
 Heaper atStore(Position key, Heaper value)
          Associate value with key, whether or not there is a previous association.
Return the old range element if the position was previously occupied, NULL otherwise
 void becomeCloneOnWrite(Heaper where)
           
 IntegerRegion contigDomainStarting(int anIdx)
           
 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'.
 void destroy()
           
 void destruct()
          Classes should implement this message rather than a destructor.
 XnRegion domain()
          Return an XuRegion representing a snapshot of the current domain.
'table->domain()->hasMember(p)' iff 'table->fetch(p) !!= NULL'.
 PtrArray elementsArray()
          return the elements array for rapid processing
 ScruTable emptySize(IntegerVar size)
          Return an empty table just like the current one.
 int endOffset()
          return the size of the elements array for rapid processing
 void enlargeAfter(IntegerVar toMinimum)
          Enlarge the receiver to contain more slots filled with nil.
 void enlargeBefore(IntegerVar toMinimum)
          Enlarge the receiver to contain more slots filled with nil.
 int fastHash()
           
 Heaper fetch(Position key)
          Return the range element at the domain position key.
 int firstElemAfter(int index)
          This method returns the first table entry that is not NULL after index.
 void fixup()
           
 IntegerRegion generateDomain()
           
 IntegerVar highestIndex()
          Given that the table is non-empty, 'intTab->highestIndex()' is equivalent to
'CAST(IntegerRegion,intTab->domain())->upperBound() -1'.
 boolean includesIntKey(IntegerVar aKey)
          Unboxed version.
 boolean includesKey(Position aKey)
          includesKey is used to test for the presence of a key->value pair in the
table.
 void inspect()
           
 Heaper intFetch(IntegerVar index)
          Unboxed version.
 boolean intWipe(IntegerVar index)
          Unboxed version.
 boolean isEmpty()
          Is there anything in the table?
'table->isEmpty()' iff 'table->domain()->isEmpty()'.
 int lastElemBefore(int index)
          This method returns the first table entry that is not NULL after index.
 IntegerVar lowestIndex()
          Given that the table is non-empty, 'intTab->lowestIndex()' is equivalent to
'CAST(IntegerRegion,intTab->domain())->lowerBound()'.
 int maxElements()
          return the size of the elements array for rapid processing
 IntegerRegion nullDomainStarting(int anIdx)
           
 ScruTable offsetSubTableBetween(IntegerVar startIndex, IntegerVar stopIndex, IntegerVar firstIndex)
          Copy the given range into a new IntegerTable.
The range is startIndex (inclusive) to stopIndex (exclusive)
The first element in the sub table will be at firstIndex
 void printOn(java.io.PrintWriter aStream)
           
 XnRegion runAt(Position anIdx)
          Return the length of the run starting at position key.
 XnRegion runAtInt(IntegerVar anIdx)
          Unboxed version.
 void sendSelfTo(Xmtr xmtr)
          do nothing
 IntegerVar startIndex()
          return the size of the elements array for rapid processing
 int startOffset()
          return the size of the elements array for rapid processing
 TableStepper stepper(OrderSpec order)
          ignore order spec for now
 ScruTable subTable(XnRegion reg)
          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.
 ScruTable subTableBetween(IntegerVar startIndex, IntegerVar stopIndex)
          Hack for C++ overloading problem
 Heaper theOne()
          Iff I contain exactly one range element, return it.
 boolean wipe(Position key)
          Remove a key->value association from the table.
Do not blast (or do anything else) if the key is not in my current domain.
Return TRUE if the association was present and removed,
Return FALSE if the association was not there
 
Methods inherited from class org.abora.gold.collection.tables.OberIntegerTable
aboutToWrite, getNextCOW, setNextCOW
 
Methods inherited from class org.abora.gold.collection.tables.IntegerTable
atIntIntroduce, atIntReplace, atIntroduce, atReplace, intRemove, make, make, make, make, make, make, make, remove
 
Methods inherited from class org.abora.gold.collection.tables.MuTable
actualHashForEqual, asImmuTable, asMuTable, initTimeNonInherited, introduceAll, introduceAll, introduceAll, isEqual, make, make, problems, removeAll, replaceAll, replaceAll, replaceAll, storeAll, storeAll, storeAll, test, wipeAll
 
Methods inherited from class org.abora.gold.collection.tables.ScruTable
asOrderedCollection, backfollowFrom, contentsEqual, contentsHash, dox, get, intGet, isEqual, printOnWithSimpleSyntax, printOnWithSyntax, range, stepper, transformedBy
 
Methods inherited from class org.abora.gold.xpp.basic.Heaper
abstractDeclarationFor, abstractTypeFor, addMethodAttributeToInOf, addPackage, addPackageCategory, allClientProtocolOn, argumentTypesFor, arrow, blast, blast, BLAST, cachePromiseNameTable, cachePromiseNameTableIn, canYouBecome, cast, cleanPromiseClasses, cleanupGarbage, clientClassesDo, clientFunctionsOn, clientMethodsOn, clientProtocol, clientProtocolDo, clientProtocolOn, clientProtocolOn, collectibleClasses, compare, compileClientSubclasses, compileConstantPromiseMethods, compileCreateFromRcvr, compileEQ, compileGeneratedClassMethod, compileGeneratedMethod, compileHook, compilePromise, compilePromiseDefaultMethods, compilePromiseFluidDeclarations, compilePromiseHandlers, compilePromiseMethods, compileRequestCreateMsgInArguments, compileRequestEvaluateMsgInReturningArguments, compileRPCSpecialistEvaluateMsgForReturningArguments, compileSendSelfTo, compileSendSelfToSendHook, compileStubbleMethods, compileSubclassStubbleMethods, computeMangle, computePreorder, constantTypeValue, convert, convertCopyDeclarations, convertDeferredDeclarations, convertProxyDeclarations, convertSubclassCopyDeclarations, convertSubclassDeferredDeclarations, convertSubclassProxyDeclarations, copyReferencesToType, create, create, create, create, create, create, create, create, create, create, createRequestClassArguments, definesProxyMethods, delete, deref, destructor, enum, enumFlags, equals, exportName, fetchAttribute, fetchPackage, fetchSuperCategory, fileOutClientProtocol, findCategory, findSenderAndReceiverMethods, findTailInto, flushPromiseNameTable, foo, freezeClientClasses, freezeClientProtocol, freezeStProtocol, frozenClasses, garbageCollect, garbageCollectFrom, gcOpportunity, gcOpportunity, generatedCategory, generatePromiseNames, getCategory, getOrMakePackage, getSuperCategory, handlerSignaturesFrom, hash, hashForEqual, hasProxyMethods, info_clientClasses, info_clientSideClasses, info_promiseClasses, info_stProtocol, inGC, initializedClasses, initializingClasses, initPackages, initStringHashSBoxes, inspectPieces, instanceSize, IntegerVar, isByProxy, isConstructed, isDestructed, isEqualOrSubclassOf, isGenerated, isIntType, isKindOf, isRawType, isUnlocked, linkTimeNonInherited, make, makeClassTable, makeFillTable, makeRequestTable, mangle, markChildren, markCount, markInstances, mayBecome, mayBecomeAnySubclassOf, new1, newX, nonCopyVariables, notWorking, pack, packageClasses, packagingCategory, parseExportName, passe, pointerToStaticMember, pointerToStaticMember, pointerToVirtualMember, preorderMax, preorderNumber, PROBLEM, promiseClass, promiseDefaultValue, promiseName, promiseNameTable, promiseToAbstract, registerPackageCategory, removeGeneratedCode, removeStubbleMethods, removeSubclassGeneratedCode, removeSubclassStubbleMethods, requestProcedure, requestProceduresFrom, returnTypeFor, rootName, scheduleTermination, sendProxyTo, serverNameFor, setGC, signal, signals, smalltalkSelector, stClientProtocol, stubbleSelectorTokenReturnsArguments, subclassNonCopyVariables, takeOop, togglePromiseName, togglePromiseOfParse, unimplemented, unmangle, verifyFreeze, wipeStubble
 
Methods inherited from class org.abora.gold.java.AboraHeaper
asOop, basicInspect, displayString, error, hack, halt, 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

elements

protected PtrArray elements

start

protected IntegerVar start

elemCount

protected int elemCount

firstElem

protected int firstElem

lastElem

protected int lastElem

tally

protected int tally

domainIsSimple

protected boolean domainIsSimple
Constructor Detail

ActualIntegerTable

public ActualIntegerTable()
The optional argument just hints at the number of elements
to eventually be added. It makes no difference semantically.


ActualIntegerTable

public ActualIntegerTable(IntegerVar size)
The optional argument just hints at the number of elements
to eventually be added. It makes no difference semantically.


ActualIntegerTable

public ActualIntegerTable(IntegerVar begin,
                          IntegerVar end)
Hint at the domain to be accessed (inclusive, exclusive).


ActualIntegerTable

public ActualIntegerTable(PtrArray array,
                          IntegerVar begin,
                          int count,
                          int first,
                          int last,
                          int aTally,
                          boolean simple)

ActualIntegerTable

public ActualIntegerTable(Rcvr receiver)
Method Detail

fastHash

public int fastHash()

includesIntKey

public boolean includesIntKey(IntegerVar aKey)
Description copied from class: ScruTable
Unboxed version. See class comment for XuInteger

Overrides:
includesIntKey in class OberIntegerTable

isEmpty

public boolean isEmpty()
Description copied from class: ScruTable
Is there anything in the table?
'table->isEmpty()' iff 'table->domain()->isEmpty()'.

Overrides:
isEmpty in class OberIntegerTable

atIntStore

public Heaper atIntStore(IntegerVar index,
                         Heaper value)
Description copied from class: MuTable
Unboxed version. See class comment for XuInteger

Overrides:
atIntStore in class OberIntegerTable

coordinateSpace

public CoordinateSpace coordinateSpace()
Description copied from class: ScruTable
The kind of elements used to index into the table are Positions of this
coordinate space. Therefore, the domain of this table is an XuRegion in this
coordinate space.

Overrides:
coordinateSpace in class OberIntegerTable

count

public IntegerVar count()
Description copied from class: ScruTable
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'. This seems clearly wrong.

Overrides:
count in class OberIntegerTable

domain

public XnRegion domain()
Description copied from class: ScruTable
Return an XuRegion representing a snapshot of the current domain.
'table->domain()->hasMember(p)' iff 'table->fetch(p) !!= NULL'.

Overrides:
domain in class OberIntegerTable

highestIndex

public IntegerVar highestIndex()
Description copied from class: OberIntegerTable
Given that the table is non-empty, 'intTab->highestIndex()' is equivalent to
'CAST(IntegerRegion,intTab->domain())->upperBound() -1'. The reason for the
'-1' is that the 'upperBound' is an exclusive upper bound (see
IntegerRegion::upperBound), whereas 'highestIndex' is the highest index which is
in my domain. I need to here specify what 'highestIndex' does if I am empty.

Overrides:
highestIndex in class OberIntegerTable

intFetch

public Heaper intFetch(IntegerVar index)
Description copied from class: ScruTable
Unboxed version. See class comment for XuInteger

Overrides:
intFetch in class OberIntegerTable

intWipe

public boolean intWipe(IntegerVar index)
Description copied from class: MuTable
Unboxed version. See class comment for XuInteger

Overrides:
intWipe in class OberIntegerTable

lowestIndex

public IntegerVar lowestIndex()
Description copied from class: OberIntegerTable
Given that the table is non-empty, 'intTab->lowestIndex()' is equivalent to
'CAST(IntegerRegion,intTab->domain())->lowerBound()'. 'lowestIndex' is the
lowest index which is in my domain. I need to here specify what 'lowestIndex'
does if I am empty.

Overrides:
lowestIndex in class OberIntegerTable

copy

public ScruTable copy()
Description copied from class: ScruTable
A new one whose initial state is my current state, but that doesn't track
changes. Note that there is no implication that these can be 'destroy'ed
separately, because (for example) an ImmuTable just returns itself

Overrides:
copy in class OberIntegerTable

destroy

public void destroy()
Overrides:
destroy in class Heaper

emptySize

public ScruTable emptySize(IntegerVar size)
Description copied from class: ScruTable
Return an empty table just like the current one. The 'size' argument is a hint
about how big the count of the table will probably become (so that the new
table can be prepared to grow to that size efficiently).

Overrides:
emptySize in class OberIntegerTable

offsetSubTableBetween

public ScruTable offsetSubTableBetween(IntegerVar startIndex,
                                       IntegerVar stopIndex,
                                       IntegerVar firstIndex)
Copy the given range into a new IntegerTable.
The range is startIndex (inclusive) to stopIndex (exclusive)
The first element in the sub table will be at firstIndex

Overrides:
offsetSubTableBetween in class OberIntegerTable

subTable

public ScruTable subTable(XnRegion reg)
Description copied from class: ScruTable
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. Of
course, subclasses may specify more. If you want to ensure snapshot behavior,
do 'table->subTable(r)->asImmuTable()'.
NOTE: In the future we may specify snapshot behavior or we may specify view
behavior. As a client this shouldn't effect you. However, if you implement a
new kind of ScruTable, please let us know. Also, if you have an opinion as to
which way you'd like the specification tightened up, please tell us.

Overrides:
subTable in class OberIntegerTable

subTableBetween

public ScruTable subTableBetween(IntegerVar startIndex,
                                 IntegerVar stopIndex)
Hack for C++ overloading problem

Overrides:
subTableBetween in class OberIntegerTable

runAtInt

public XnRegion runAtInt(IntegerVar anIdx)
Description copied from class: ScruTable
Unboxed version. See class comment for XuInteger

Overrides:
runAtInt in class OberIntegerTable

printOn

public void printOn(java.io.PrintWriter aStream)
Overrides:
printOn in class ScruTable

stepper

public TableStepper stepper(OrderSpec order)
ignore order spec for now

Overrides:
stepper in class OberIntegerTable

theOne

public Heaper theOne()
Description copied from class: ScruTable
Iff I contain exactly one range element, return it. Otherwise BLAST.
The idea for this message is taken from the THE function of ONTIC
(reference McAllester)

Overrides:
theOne in class ScruTable

contigDomainStarting

public IntegerRegion contigDomainStarting(int anIdx)

elementsArray

public PtrArray elementsArray()
return the elements array for rapid processing

Overrides:
elementsArray in class OberIntegerTable

endOffset

public int endOffset()
return the size of the elements array for rapid processing

Overrides:
endOffset in class OberIntegerTable

enlargeAfter

public void enlargeAfter(IntegerVar toMinimum)
Enlarge the receiver to contain more slots filled with nil.


enlargeBefore

public void enlargeBefore(IntegerVar toMinimum)
Enlarge the receiver to contain more slots filled with nil.


firstElemAfter

public int firstElemAfter(int index)
This method returns the first table entry that is not NULL after index.


generateDomain

public IntegerRegion generateDomain()

lastElemBefore

public int lastElemBefore(int index)
This method returns the first table entry that is not NULL after index.


maxElements

public int maxElements()
return the size of the elements array for rapid processing


nullDomainStarting

public IntegerRegion nullDomainStarting(int anIdx)

startIndex

public IntegerVar startIndex()
return the size of the elements array for rapid processing

Overrides:
startIndex in class OberIntegerTable

startOffset

public int startOffset()
return the size of the elements array for rapid processing

Overrides:
startOffset in class OberIntegerTable

fixup

public void fixup()

inspect

public void inspect()
Overrides:
inspect in class AboraHeaper

destruct

public void destruct()
Description copied from class: Heaper
Classes should implement this message rather than a destructor. We use this so
the destruction behavior implemented in abstract superclasses can access the
vtable of the concrete run-time type in C++. Using a message makes C++
parallel the Smalltalk semantics for delete. Destroy will actually call the destructor.

Overrides:
destruct in class Heaper

becomeCloneOnWrite

public void becomeCloneOnWrite(Heaper where)
Overrides:
becomeCloneOnWrite in class OberIntegerTable

atStore

public Heaper atStore(Position key,
                      Heaper value)
Description copied from class: MuTable
Associate value with key, whether or not there is a previous association.
Return the old range element if the position was previously occupied, NULL otherwise

Overrides:
atStore in class OberIntegerTable

fetch

public Heaper fetch(Position key)
Description copied from class: ScruTable
Return the range element at the domain position key. The routine will return
NULL if the position is not in the table.

Overrides:
fetch in class OberIntegerTable

includesKey

public boolean includesKey(Position aKey)
Description copied from class: ScruTable
includesKey is used to test for the presence of a key->value pair in the
table. This routine returns true if there is a value present at the specified
key, and false otherwise.
'table->includesKey(p)' iff 'table->domain()->hasMember(p)'.

Overrides:
includesKey in class OberIntegerTable

runAt

public XnRegion runAt(Position anIdx)
Description copied from class: ScruTable
Return the length of the run starting at position key. A run is defined as a
contiguous (charming) sequence of domain positions mapping to equal (isEqual)
objects. Charming is defined as: Given a charming region R, for all a,c which
are elements of R and a >= b >= c, b is an element of R. Where '>=' is
according to the 'isGE' message.
NOTE: We may retire the above definition of charming. The possible changes
will only effect spaces which aren't fully ordered. OrderedRegions,
TreeRegions, and IntegerRegions will be unaffected, as any future definition of
'runAt' will be equivalent for them.

Overrides:
runAt in class OberIntegerTable

wipe

public boolean wipe(Position key)
Description copied from class: MuTable
Remove a key->value association from the table.
Do not blast (or do anything else) if the key is not in my current domain.
Return TRUE if the association was present and removed,
Return FALSE if the association was not there

Overrides:
wipe in class OberIntegerTable

sendSelfTo

public void sendSelfTo(Xmtr xmtr)
Description copied from class: Heaper
do nothing

Overrides:
sendSelfTo in class MuTable


Translation - Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.