org.abora.gold.collection.basic
Class PtrArray

java.lang.Object
  |
  +--org.abora.gold.java.AboraHeaper
        |
        +--org.abora.gold.xpp.basic.Heaper
              |
              +--org.abora.gold.collection.basic.PrimArray
                    |
                    +--org.abora.gold.collection.basic.PtrArray
Direct Known Subclasses:
SharedPtrArray, WeakPtrArray

public class PtrArray
extends PrimArray


Field Summary
 
Fields inherited from class org.abora.gold.collection.basic.PrimArray
OurGutsCount
 
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
protected PtrArray(int count, int TCSJ)
           
protected PtrArray(int count, int[] buffer)
           
protected PtrArray(int size, PrimArray from, int sourceOffset, int count, int destOffset)
           
 
Method Summary
 BooleanVar contentsEQ(PtrArray other)
           
 BooleanVar contentsEqual(PrimArray other)
          Whether the two ranges contain semantically the same values.
 int contentsHash()
          A hash of the entire contents of the array.
 void copyToBuffer(int[] buffer, int size, int count, int start)
          Copy of a piece of this array into the provided buffer with size bytes of space available.
 BooleanVar elementsEQ(int here, PrimArray other)
           
 BooleanVar elementsEQ(int here, PrimArray other, int there)
           
 BooleanVar elementsEQ(int here, PrimArray other, int there, int count)
           
 BooleanVar elementsEqual(int here, PrimArray other, int there, int count)
          Whether the two ranges contain the same values, using the criteria defined in contentsEqual
 int elementsHash(int count, int start)
          A hash of the range of values out of the array.
static PtrArray empty()
          create a zero size PtrArray
 Heaper fetch(int index)
          Retrieve a single element from the array.
 Heaper fetchValue(int index)
          Fetch a value; may be a Heaper, NULL, or a PrimValue as appropriate to PrimArray subclass.
 Heaper get(int index)
          Retrieve a single element from the array.
 int indexOf(Heaper value, int start, int n)
          The index of the nth occurrence of the given value at or after (before if n is negative) the given index, or -1 if there is none.
 int indexOfEQ(Heaper value)
           
 int indexOfEQ(Heaper value, int start)
           
 int indexOfEQ(Heaper value, int start, int n)
           
 int indexOfEQOrNull(Heaper value)
           
 int indexOfEQOrNull(Heaper value, int start)
           
 int indexOfEQOrNull(Heaper value, int start, int n)
           
 int indexPast(Heaper value, int start, int n)
          The index of the nth occurrence of anything but the given value at or after (before if n is negative) the given index, or -1 if there is none.
 int indexPastEQ(Heaper value)
           
 int indexPastEQ(Heaper value, int start)
           
 int indexPastEQ(Heaper value, int start, int n)
           
static PtrArray make(int count, int[] buffer)
          create a PtrArray filled with data from 'buffer'
static PtrArray make(int size, PrimArray from)
           
static PtrArray make(int size, PrimArray from, int sourceOffset)
           
static PtrArray make(int size, PrimArray from, int sourceOffset, int count)
           
static PtrArray make(int size, PrimArray from, int sourceOffset, int count, int destOffset)
          create a PtrArray filled with the indicated data in 'from'
protected  PrimArray makeNew(int size, PrimArray source, int sourceOffset, int count, int destOffset)
           
 void migrate(int[] destination, BooleanVar destinationIsOld)
           
static PtrArray nulls(int count)
          create a PtrArray filled with NULLs
protected  void printElementOn(int index, Stream oo)
           
 PrimSpec spec()
          A description of the kinds of things which can be stored in this array
 void store(int index, Heaper pointer)
           
 void storeAll(Heaper value, int count, int start)
          Set a range of elements to have the same value
 void storeValue(int index, Heaper value)
          Store a value; may be a Heaper, NULL, or a PrimValue as appropriate to PrimArray subclass.
 Heaper unsafeFetch(int index)
          for bulk methods that need checking and for migration
 void unsafeStore(int index, Heaper ptr)
          for bulk methods that need checking and for migration
 
Methods inherited from class org.abora.gold.collection.basic.PrimArray
cleanup, copy, copy, copy, copy, copy, copyElements, copyGrow, copyToBuffer, copyToBuffer, count, elementsEqual, elementsEqual, elementsHash, elementsHash, getValue, indexOf, indexOf, indexOfElements, indexOfElements, indexOfElements, indexOfElements, indexOfElements, indexPast, indexPast, moveTo, outOfBounds, printElementOn, printOn, rangeCheck, size, storage, storeAll, storeAll, storeAll, storeMany, storeMany, storeMany, zeroElements, zeroElements, zeroElements
 
Methods inherited from class org.abora.gold.xpp.basic.Heaper
abstractDeclarationFor, abstractTypeFor, actualHashForEqual, 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, destroy, destruct, 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, isEqual, 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, problems, promiseClass, promiseDefaultValue, promiseName, promiseNameTable, promiseToAbstract, registerPackageCategory, removeGeneratedCode, removeStubbleMethods, removeSubclassGeneratedCode, removeSubclassStubbleMethods, requestProcedure, requestProceduresFrom, returnTypeFor, rootName, scheduleTermination, sendProxyTo, sendSelfTo, 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, 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
 

Constructor Detail

PtrArray

protected PtrArray(int count,
                   int TCSJ)

PtrArray

protected PtrArray(int size,
                   PrimArray from,
                   int sourceOffset,
                   int count,
                   int destOffset)

PtrArray

protected PtrArray(int count,
                   int[] buffer)
Method Detail

nulls

public static PtrArray nulls(int count)
create a PtrArray filled with NULLs


make

public static PtrArray make(int size,
                            PrimArray from,
                            int sourceOffset,
                            int count,
                            int destOffset)
create a PtrArray filled with the indicated data in 'from'


make

public static PtrArray make(int size,
                            PrimArray from,
                            int sourceOffset,
                            int count)

make

public static PtrArray make(int size,
                            PrimArray from,
                            int sourceOffset)

make

public static PtrArray make(int size,
                            PrimArray from)

make

public static PtrArray make(int count,
                            int[] buffer)
create a PtrArray filled with data from 'buffer'


empty

public static PtrArray empty()
create a zero size PtrArray


store

public void store(int index,
                  Heaper pointer)

get

public Heaper get(int index)
Retrieve a single element from the array. Does array bounds checking. BLAST if NULL


fetch

public Heaper fetch(int index)
Retrieve a single element from the array. Does array bounds checking. Non-pointer arrays box up the contents in a PrimValue object.


storeValue

public void storeValue(int index,
                       Heaper value)
Description copied from class: PrimArray
Store a value; may be a Heaper, NULL, or a PrimValue as appropriate to PrimArray subclass. It is expected that most PrimArray clients will want to use less abstract access methods

Overrides:
storeValue in class PrimArray

fetchValue

public Heaper fetchValue(int index)
Description copied from class: PrimArray
Fetch a value; may be a Heaper, NULL, or a PrimValue as appropriate to PrimArray subclass. It is expected that most PrimArray clients will want to use less abstract access methods.

Overrides:
fetchValue in class PrimArray

spec

public PrimSpec spec()
Description copied from class: PrimArray
A description of the kinds of things which can be stored in this array

Overrides:
spec in class PrimArray

contentsEQ

public BooleanVar contentsEQ(PtrArray other)

contentsEqual

public BooleanVar contentsEqual(PrimArray other)
Description copied from class: PrimArray
Whether the two ranges contain semantically the same values. Two non-NULL pointers match iff the Heapers they point to are isEqual. Two integers match iff they have the same value, even though they may be represented as different sizes. Two floats likewise.

Overrides:
contentsEqual in class PrimArray

contentsHash

public int contentsHash()
Description copied from class: PrimArray
A hash of the entire contents of the array. If two arrays are contentsEqual, they will have the same contentsHash.

Overrides:
contentsHash in class PrimArray

indexOf

public int indexOf(Heaper value,
                   int start,
                   int n)
Description copied from class: PrimArray
The index of the nth occurrence of the given value at or after (before if n is negative) the given index, or -1 if there is none.

Overrides:
indexOf in class PrimArray

indexPast

public int indexPast(Heaper value,
                     int start,
                     int n)
Description copied from class: PrimArray
The index of the nth occurrence of anything but the given value at or after (before if n is negative) the given index, or -1 if there is none.

Overrides:
indexPast in class PrimArray

storeAll

public void storeAll(Heaper value,
                     int count,
                     int start)
Description copied from class: PrimArray
Set a range of elements to have the same value

Overrides:
storeAll in class PrimArray

copyToBuffer

public void copyToBuffer(int[] buffer,
                         int size,
                         int count,
                         int start)
Description copied from class: PrimArray
Copy of a piece of this array into the provided buffer with size bytes of space available. The default is to start at the beginning and go to the end. The elements will be copied from this array beginning with start, and taking as many of count elements or upto the end of this array as will fit in size bytes. WARNING: Note that if this array is a PtrArray, the pointers copied to buffer will not be considered as references for garbage collection. Therefore the buffer should not be allowed to contain the only pointer to an object in a garbage collecting environment.

Overrides:
copyToBuffer in class PrimArray

indexOfEQ

public int indexOfEQ(Heaper value,
                     int start,
                     int n)

indexOfEQ

public int indexOfEQ(Heaper value,
                     int start)

indexOfEQ

public int indexOfEQ(Heaper value)

indexOfEQOrNull

public int indexOfEQOrNull(Heaper value,
                           int start,
                           int n)

indexOfEQOrNull

public int indexOfEQOrNull(Heaper value,
                           int start)

indexOfEQOrNull

public int indexOfEQOrNull(Heaper value)

indexPastEQ

public int indexPastEQ(Heaper value,
                       int start,
                       int n)

indexPastEQ

public int indexPastEQ(Heaper value,
                       int start)

indexPastEQ

public int indexPastEQ(Heaper value)

elementsEQ

public BooleanVar elementsEQ(int here,
                             PrimArray other,
                             int there,
                             int count)

elementsEQ

public BooleanVar elementsEQ(int here,
                             PrimArray other,
                             int there)

elementsEQ

public BooleanVar elementsEQ(int here,
                             PrimArray other)

elementsEqual

public BooleanVar elementsEqual(int here,
                                PrimArray other,
                                int there,
                                int count)
Description copied from class: PrimArray
Whether the two ranges contain the same values, using the criteria defined in contentsEqual

Overrides:
elementsEqual in class PrimArray

elementsHash

public int elementsHash(int count,
                        int start)
Description copied from class: PrimArray
A hash of the range of values out of the array. If two ranges are elementsEqual, they will have the same hash. For data values, additional zeros on the end make no difference to the hash.

Overrides:
elementsHash in class PrimArray

printElementOn

protected void printElementOn(int index,
                              Stream oo)

makeNew

protected PrimArray makeNew(int size,
                            PrimArray source,
                            int sourceOffset,
                            int count,
                            int destOffset)
Overrides:
makeNew in class PrimArray

unsafeStore

public void unsafeStore(int index,
                        Heaper ptr)
for bulk methods that need checking and for migration


unsafeFetch

public Heaper unsafeFetch(int index)
for bulk methods that need checking and for migration


migrate

public void migrate(int[] destination,
                    BooleanVar destinationIsOld)


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