org.abora.gold.collection.sets
Class ActualHashSet

java.lang.Object
  |
  +--org.abora.gold.java.AboraHeaper
        |
        +--org.abora.gold.xpp.basic.Heaper
              |
              +--org.abora.gold.collection.sets.ScruSet
                    |
                    +--org.abora.gold.collection.sets.MuSet
                          |
                          +--org.abora.gold.collection.sets.HashSet
                                |
                                +--org.abora.gold.collection.sets.ActualHashSet

public class ActualHashSet
extends HashSet


Field Summary
protected static IntegerVar AddOver
           
protected static Array AddTallys
           
protected static IntegerVar DeleteOver
           
protected static Array DeleteTallys
           
protected  SharedPtrArray myHashEntries
           
protected  UInt32Array myHashValues
           
protected  int myTally
           
protected static IntegerVar NewSetCount
           
protected static IntegerVar SetKillCount
           
protected static IntegerVar StepperCount
           
protected static IntegerVar StepperOver
           
protected static Array StepperTally
           
protected static IntegerVar TestOver
           
protected static Array TestTallys
           
 
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
ActualHashSet(int newTally, SharedPtrArray entries)
           
ActualHashSet(int newTally, UInt32Array hashValues, SharedPtrArray entries)
           
ActualHashSet(Rcvr receiver)
           
 
Method Summary
 void aboutToWrite()
          If my contents are shared, and I'm about to change them, make a copy of them.
 void actualAboutToWrite()
           
static java.lang.String arrayStats(Array array)
           
 void checkSize(int byAmount)
           
static void cleanupGarbage()
          Heaper cleanupGarbage
 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.
 ScruSet copy()
          A new one whose initial state is my current state, but that doesn't track
changes.
 IntegerVar count()
          How many elements are currently in the set.
static void countAdd(IntegerVar tally)
           
static void countDelete(IntegerVar tally)
           
static void countStepper(IntegerVar tally)
           
static void countTest(IntegerVar tally)
           
 void destruct()
          Classes should implement this message rather than a destructor.
 int distanceFromHome(int loc, int home, int modulus)
           
 int entryTableSize()
           
 int hashFind(Heaper item)
          Starting at the item's preferred location and iterating (not recurring!!) around the set's
storage while the slots we're examining are occupied...
If the current slot's occupant is the target item, return a hit
if the current occupant is closer to it's preferred location, return a miss.
If we've gone all the way around, return a miss.
 void hashRemove(int from)
          Remove the indicated item from the set.
Iteratively (not recursively!!) move other items up until one is NULL or happier where it
is.
 void hashStore(Heaper item, UInt32Array values, PtrArray entries)
          Starting at the new item's preferred location and iterating (not recurring!!) around the
set's storage while the slots we're examining are occupied.
 boolean hasMember(Heaper someone)
          Is someone a member of the set now?
static void initTimeNonInherited()
           
 void introduce(Heaper anElement)
          Add anElement to my members, but only if it isn't already a member.
If it is already a member, BLAST
 boolean isEmpty()
          Whether it currently has any elements
static void linkTimeNonInherited()
           
static Heaper make()
           
static Heaper make(Heaper something)
           
static Heaper make(IntegerVar someSize)
          someSize is a non-semantic hint about how big the set might get.
 void printInternals(java.io.PrintWriter oo)
          This method is for regression testing.
 void receiveHashSet(Rcvr rcvr)
          Make myHashEntries large enough that we won't grow.
 void remove(Heaper anElement)
          Remove anElement from my members.
 void sendHashSet(Xmtr xmtr)
          This currently doesn't take advantage of the optimizations in TableEntries.
 void sendSelfTo(Xmtr xmtr)
          do nothing
 Stepper stepper()
          Returns a stepper which will enumerate all the elements of the set in some unspecified
order
 void store(Heaper anElement)
          maintainance note: storeAll: has a copy of the code starting at self hashFind:...
 void storeAll(ScruSet other)
          union equivalent
 Heaper theOne()
          Iff I contain exactly one member, return it.
 void wipe(Heaper anElement)
          make anElement no longer be one of my members.
 void wipeAll(ScruSet other)
          Sort of minus.
 
Methods inherited from class org.abora.gold.collection.sets.HashSet
asImmuSet, asMuSet, immuStepper
 
Methods inherited from class org.abora.gold.collection.sets.MuSet
actualHashForEqual, fromStepper, isEqual, make, make, problems, restrictTo
 
Methods inherited from class org.abora.gold.collection.sets.ScruSet
asArray, asOrderedCollection, contentsEqual, dox, inspect, intersects, isEqual, isSubsetOf, printOn, printOnWithSimpleSyntax, printOnWithSyntax
 
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, 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, 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, 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

myHashValues

protected UInt32Array myHashValues

myHashEntries

protected SharedPtrArray myHashEntries

myTally

protected int myTally

AddOver

protected static IntegerVar AddOver

AddTallys

protected static Array AddTallys

DeleteOver

protected static IntegerVar DeleteOver

DeleteTallys

protected static Array DeleteTallys

NewSetCount

protected static IntegerVar NewSetCount

SetKillCount

protected static IntegerVar SetKillCount

StepperCount

protected static IntegerVar StepperCount

StepperOver

protected static IntegerVar StepperOver

StepperTally

protected static Array StepperTally

TestOver

protected static IntegerVar TestOver

TestTallys

protected static Array TestTallys
Constructor Detail

ActualHashSet

public ActualHashSet(int newTally,
                     SharedPtrArray entries)

ActualHashSet

public ActualHashSet(int newTally,
                     UInt32Array hashValues,
                     SharedPtrArray entries)

ActualHashSet

public ActualHashSet(Rcvr receiver)
Method Detail

contentsHash

public int contentsHash()
Description copied from class: ScruSet
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.

Overrides:
contentsHash in class ScruSet

count

public IntegerVar count()
Description copied from class: ScruSet
How many elements are currently in the set. Being a set, if the same element is put into
the set twice,
it is only in the set once. 'Same' above is according to 'isEqual'.

Overrides:
count in class HashSet

hasMember

public boolean hasMember(Heaper someone)
Description copied from class: ScruSet
Is someone a member of the set now?

Overrides:
hasMember in class HashSet

isEmpty

public boolean isEmpty()
Description copied from class: ScruSet
Whether it currently has any elements

Overrides:
isEmpty in class HashSet

copy

public ScruSet copy()
Description copied from class: ScruSet
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 ImmuSet just returns itself

Overrides:
copy in class HashSet

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

stepper

public Stepper stepper()
Description copied from class: ScruSet
Returns a stepper which will enumerate all the elements of the set in some unspecified
order

Overrides:
stepper in class HashSet

theOne

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

Overrides:
theOne in class HashSet

storeAll

public void storeAll(ScruSet other)
union equivalent

Overrides:
storeAll in class MuSet

wipeAll

public void wipeAll(ScruSet other)
Sort of minus. Wipe from myself all elements from other.
Turn myself into my current self minus other.

Overrides:
wipeAll in class MuSet

introduce

public void introduce(Heaper anElement)
Description copied from class: MuSet
Add anElement to my members, but only if it isn't already a member.
If it is already a member, BLAST

Overrides:
introduce in class HashSet

remove

public void remove(Heaper anElement)
Description copied from class: MuSet
Remove anElement from my members. If it isn't currently a member, then BLAST

Overrides:
remove in class HashSet

store

public void store(Heaper anElement)
maintainance note: storeAll: has a copy of the code starting at self hashFind:... for
efficiency.

Overrides:
store in class HashSet

wipe

public void wipe(Heaper anElement)
Description copied from class: HashSet
make anElement no longer be one of my members. No semantic effect if it already isn't a
member.

Overrides:
wipe in class HashSet

aboutToWrite

public void aboutToWrite()
If my contents are shared, and I'm about to change them, make a copy of them.


actualAboutToWrite

public void actualAboutToWrite()

checkSize

public void checkSize(int byAmount)

distanceFromHome

public int distanceFromHome(int loc,
                            int home,
                            int modulus)

hashFind

public int hashFind(Heaper item)
Starting at the item's preferred location and iterating (not recurring!!) around the set's
storage while the slots we're examining are occupied...
If the current slot's occupant is the target item, return a hit
if the current occupant is closer to it's preferred location, return a miss.
If we've gone all the way around, return a miss.


hashRemove

public void hashRemove(int from)
Remove the indicated item from the set.
Iteratively (not recursively!!) move other items up until one is NULL or happier where it
is.


hashStore

public void hashStore(Heaper item,
                      UInt32Array values,
                      PtrArray entries)
Starting at the new item's preferred location and iterating (not recurring!!) around the
set's storage while the slots we're examining are occupied. (Caller assures us there IS a
vacant slot) if the current occupant is no closer to it's preferred location, exchange it
with the 'new' one. Bail out if the current occupant IS the new one.
Store the currently 'new' item.


entryTableSize

public int entryTableSize()

printInternals

public void printInternals(java.io.PrintWriter oo)
This method is for regression testing.

Overrides:
printInternals in class HashSet

receiveHashSet

public void receiveHashSet(Rcvr rcvr)
Make myHashEntries large enough that we won't grow.


sendHashSet

public void sendHashSet(Xmtr xmtr)
This currently doesn't take advantage of the optimizations in TableEntries. It should.


sendSelfTo

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

Overrides:
sendSelfTo in class Heaper

cleanupGarbage

public static void cleanupGarbage()
Description copied from class: Heaper
Heaper cleanupGarbage


initTimeNonInherited

public static void initTimeNonInherited()

linkTimeNonInherited

public static void linkTimeNonInherited()

make

public static Heaper make()

make

public static Heaper make(Heaper something)

make

public static Heaper make(IntegerVar someSize)
Description copied from class: MuSet
someSize is a non-semantic hint about how big the set might get.


arrayStats

public static java.lang.String arrayStats(Array array)

countAdd

public static void countAdd(IntegerVar tally)

countDelete

public static void countDelete(IntegerVar tally)

countStepper

public static void countStepper(IntegerVar tally)

countTest

public static void countTest(IntegerVar tally)


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