org.abora.white.collection.sets
Class HashSet

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.collection.sets.ScruSet
              |
              +--org.abora.white.collection.sets.MuSet
                    |
                    +--org.abora.white.collection.sets.HashSet
Direct Known Subclasses:
ActualHashSet

public abstract class HashSet
extends MuSet

MuSet based on the the hashForEqual method for set elements.


Constructor Summary
protected HashSet()
           
protected HashSet(Rcvr rcvr)
           
 
Method Summary
 ImmuSet asImmuSet()
          Return an immu snapshot of my current state.
 MuSet asMuSet()
          Return a Mu whose initial state is the same as my current state, but which will now deviate independently of me.
abstract  ScruSet copy()
          A new one whose initial state is my current state, but that doesn't track changes.
abstract  IntegerValue count()
          How many elements are currently in the set.
abstract  boolean hasMember(Heaper someone)
          Is someone a member of the set now?
protected  Stepper immuStepper()
           
abstract  void introduce(Heaper anElement)
          Add anElement to my members, but only if it isn't already a member.
abstract  boolean isEmpty()
          Return true if this set does not currently have any elements.
static MuSet make()
           
static MuSet make(Heaper something)
           
static MuSet make(IntegerValue someSize)
          someSize is a non-semantic hint about how big the set might get.
protected abstract  void printInternals(java.io.PrintWriter oo)
           
abstract  void remove(Heaper anElement)
          Remove anElement from my members.
abstract  Stepper stepper()
          Returns a stepper which will enumerate all the elements of the set in some unspecified order
abstract  void store(Heaper anElement)
          Add anElement to my set of members.
abstract  Heaper theOne()
          Iff I contain exactly one member, return it.
abstract  void wipe(Heaper anElement)
          make anElement no longer be one of my members.
 
Methods inherited from class org.abora.white.collection.sets.MuSet
actualHashForEqual, fromStepper, isEqual, restrictTo, storeAll, wipeAll
 
Methods inherited from class org.abora.white.collection.sets.ScruSet
asArray, contentsEqual, contentsHash, intersects, isSubsetOf, printOn, printOnWithSimpleSyntax, printOnWithSyntax
 
Methods inherited from class org.abora.white.xpp.basic.Heaper
destroy, destruct, equals, hashForEqual, printContentsOn, sendSelfTo, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HashSet

protected HashSet()

HashSet

protected HashSet(Rcvr rcvr)
Method Detail

make

public static MuSet make()

make

public static MuSet make(Heaper something)

make

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


hasMember

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

Specified by:
hasMember in class MuSet

isEmpty

public abstract boolean isEmpty()
Description copied from class: ScruSet
Return true if this set does not currently have any elements.

Specified by:
isEmpty in class MuSet
Returns:
true if this set does not currently have any elements.

copy

public abstract 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

Specified by:
copy in class MuSet

count

public abstract IntegerValue 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'.

Specified by:
count in class MuSet

stepper

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

Specified by:
stepper in class MuSet

theOne

public abstract 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 ScruSet

introduce

public abstract 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

Specified by:
introduce in class MuSet

remove

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

Specified by:
remove in class MuSet

store

public abstract void store(Heaper anElement)
Add anElement to my set of members. No semantic effect if anElement is already a member.

Specified by:
store in class MuSet

wipe

public abstract void wipe(Heaper anElement)
make anElement no longer be one of my members. No semantic effect if it already isn't a member.

Specified by:
wipe in class MuSet

asImmuSet

public ImmuSet asImmuSet()
Description copied from class: ScruSet
Return an immu snapshot of my current state. Should probably be done with a Converter rather than with a message (for the reasons listed in the Converter class comment). In terms of the Stamp/Bert analogy mentioned in the class comment, asImmuSet is like asking for the current Stamp.

Overrides:
asImmuSet in class MuSet

asMuSet

public MuSet asMuSet()
Description copied from class: ScruSet
Return a Mu whose initial state is the same as my current state, but which will now deviate independently of me. In terms of the Stamp/Bert analogy mentioned in the class comment, asMuSet is like asking for a new Bert starting on the current Stamp.

Overrides:
asMuSet in class MuSet

printInternals

protected abstract void printInternals(java.io.PrintWriter oo)

immuStepper

protected Stepper immuStepper()
Specified by:
immuStepper in class MuSet


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