org.abora.white.collection.settable
Class SetTable

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.collection.settable.SetTable

public class SetTable
extends Heaper

SetTable is a table-like object (NOT at true table) that can store multiple values at a single position. See MuTable for comments on the protocol. The reason that this is not a table subclass is because of several ambiguities in the contract. For example, replace for a table implies that the position must be previously occupied, but in a settable the position is occupied only if the exact association (key->value) is present.


Field Summary
protected  CoordinateSpace myCoordinateSpace
           
protected  SharedPtrArray myHashEntries
           
protected  int myTally
           
 
Constructor Summary
SetTable(Rcvr receiver)
           
SetTable(SharedPtrArray entries, int tally, CoordinateSpace cs)
           
 
Method Summary
 void aboutToWrite()
          If my contents are shared, and I'm about to change them, make a copy of them.
 int actualHashForEqual()
          Defined by subclasses to produce the value returned by hashForEqual.
 boolean atIncludes(Position key, Heaper value)
           
 void atIntIntroduce(IntegerValue index, Heaper anObject)
           
 void atIntroduce(Position aKey, Heaper anObject)
          Store anObject at position aKey; BLAST if position is already occupied (for SetTable, there must be an object that isEqual to anObject at aKey for the position to be considered occupied)
 boolean atIntStore(IntegerValue index, Heaper anObject)
           
 boolean atStore(Position aKey, Heaper anObject)
          Store anObject at position aKey; return TRUE if store accomplished, FALSE otherwise
 void checkSize()
           
 CoordinateSpace coordinateSpace()
           
 IntegerValue count()
           
 void destruct()
           
 XnRegion domain()
           
 SetTable emptySize(IntegerValue size)
          return an empty table just like the current one
 boolean includesKey(Position aKey)
           
 void intRemove(IntegerValue index, Heaper value)
           
 boolean isEmpty()
           
 boolean isEqual(Heaper other)
          Return true if the two objects are equal.
static SetTable make(CoordinateSpace cs)
           
static SetTable make(CoordinateSpace cs, IntegerValue size)
           
 void printOn(java.io.PrintWriter oo)
          This should rarely be overridden.
 void printOnWithSimpleSyntax(java.io.PrintWriter oo, java.lang.String open, java.lang.String sep, java.lang.String close)
           
 void remove(Position key, Heaper value)
           
 XnRegion runAt(Position index)
           
 XnRegion runAtInt(IntegerValue index)
           
 void sendSelfTo(Xmtr xmtr)
           
 TableStepper stepper()
           
 TableStepper stepper(OrderSpec order)
          ignore order spec for now
 Stepper stepperAt(Position key)
           
 Stepper stepperAtInt(IntegerValue index)
           
 void storeEntry(TableEntry entry)
           
 boolean wipe(IntegerValue index, Heaper value)
           
 boolean wipeAssociation(Position key, Heaper value)
           
 
Methods inherited from class org.abora.white.xpp.basic.Heaper
destroy, equals, hashForEqual, printContentsOn, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myHashEntries

protected SharedPtrArray myHashEntries

myTally

protected int myTally

myCoordinateSpace

protected CoordinateSpace myCoordinateSpace
Constructor Detail

SetTable

public SetTable(SharedPtrArray entries,
                int tally,
                CoordinateSpace cs)

SetTable

public SetTable(Rcvr receiver)
Method Detail

atIntroduce

public void atIntroduce(Position aKey,
                        Heaper anObject)
Store anObject at position aKey; BLAST if position is already occupied (for SetTable, there must be an object that isEqual to anObject at aKey for the position to be considered occupied)


atStore

public boolean atStore(Position aKey,
                       Heaper anObject)
Store anObject at position aKey; return TRUE if store accomplished, FALSE otherwise


atIntIntroduce

public void atIntIntroduce(IntegerValue index,
                           Heaper anObject)

atIntStore

public boolean atIntStore(IntegerValue index,
                          Heaper anObject)

coordinateSpace

public CoordinateSpace coordinateSpace()

count

public IntegerValue count()

domain

public XnRegion domain()

intRemove

public void intRemove(IntegerValue index,
                      Heaper value)

remove

public void remove(Position key,
                   Heaper value)

wipe

public boolean wipe(IntegerValue index,
                    Heaper value)

wipeAssociation

public boolean wipeAssociation(Position key,
                               Heaper value)

printOn

public void printOn(java.io.PrintWriter oo)
Description copied from class: Heaper
This should rarely be overridden. In Tofu, it prints ClassName(...), where ... is either produced by printInsideOn or is ??? if printInsideOn it not overridden.

Overrides:
printOn in class Heaper

printOnWithSimpleSyntax

public void printOnWithSimpleSyntax(java.io.PrintWriter oo,
                                    java.lang.String open,
                                    java.lang.String sep,
                                    java.lang.String close)

runAt

public XnRegion runAt(Position index)

runAtInt

public XnRegion runAtInt(IntegerValue index)

stepper

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


stepperAt

public Stepper stepperAt(Position key)

stepperAtInt

public Stepper stepperAtInt(IntegerValue index)

destruct

public void destruct()
Overrides:
destruct in class Heaper

emptySize

public SetTable emptySize(IntegerValue size)
return an empty table just like the current one


stepper

public TableStepper stepper()

atIncludes

public boolean atIncludes(Position key,
                          Heaper value)

includesKey

public boolean includesKey(Position aKey)

isEmpty

public boolean isEmpty()

aboutToWrite

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


checkSize

public void checkSize()

storeEntry

public void storeEntry(TableEntry entry)

actualHashForEqual

public int actualHashForEqual()
Description copied from class: Heaper
Defined by subclasses to produce the value returned by hashForEqual.

Overrides:
actualHashForEqual in class Heaper

isEqual

public boolean isEqual(Heaper other)
Description copied from class: Heaper
Return true if the two objects are equal.

Specified by:
isEqual in class Heaper

sendSelfTo

public void sendSelfTo(Xmtr xmtr)
Overrides:
sendSelfTo in class Heaper

make

public static SetTable make(CoordinateSpace cs)

make

public static SetTable make(CoordinateSpace cs,
                            IntegerValue size)


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