org.abora.white.collection.sets
Class ImmuSetOnMu

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.collection.sets.ScruSet
              |
              +--org.abora.white.collection.sets.ImmuSet
                    |
                    +--org.abora.white.collection.sets.ImmuSetOnMu

public class ImmuSetOnMu
extends ImmuSet

Implementation of ImmuSet by delegating to an internal MuSet which actually holds the members of the set.


Field Summary
protected  MuSet setInternal
           
 
Fields inherited from class org.abora.white.collection.sets.ImmuSet
EmptySet
 
Constructor Summary
protected ImmuSetOnMu(MuSet fromSet)
          this set should be a copy for my own use
protected ImmuSetOnMu(Rcvr receiver)
           
 
Method Summary
 MuSet asMuSet()
          Return a Mu whose initial state is the same as my current state, but which will now deviate independently of me.
 IntegerValue count()
          How many elements are currently in the set.
 void destruct()
           
 boolean hasMember(Heaper someone)
          Is someone a member of the set now?
 ImmuSet intersect(ScruSet another)
          Regular set intersection.
 boolean isEmpty()
          Return true if this set does not currently have any elements.
 boolean isSubsetOf(ScruSet another)
          Whether another currently has all my elements
static ImmuSet make(MuSet aSet)
           
 ImmuSet minus(ScruSet another)
          Return an ImmuSet containing those of my members which aren't members of 'another'
 void sendSelfTo(Xmtr xmtr)
           
 Stepper stepper()
          Returns a stepper which will enumerate all the elements of the set in some unspecified order
 Heaper theOne()
          Iff I contain exactly one member, return it.
 ImmuSet unionWith(ScruSet another)
          Return an ImmuSet containing those objects with are members of either of us
 ImmuSet with(Heaper anElement)
          'set->with (anElement)' means the same as 'set->unionWith (immuSet (anElement))'.
 ImmuSet without(Heaper anElement)
          'set->without (anElement)' means the same as 'set->minus (immuSet (anElement))'.
 
Methods inherited from class org.abora.white.collection.sets.ImmuSet
actualHashForEqual, asImmuSet, copy, from, isEqual, make, newWith
 
Methods inherited from class org.abora.white.collection.sets.ScruSet
asArray, contentsEqual, contentsHash, intersects, printOn, printOnWithSimpleSyntax, printOnWithSyntax
 
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

setInternal

protected MuSet setInternal
Constructor Detail

ImmuSetOnMu

protected ImmuSetOnMu(MuSet fromSet)
this set should be a copy for my own use


ImmuSetOnMu

protected ImmuSetOnMu(Rcvr receiver)
Method Detail

make

public static ImmuSet make(MuSet aSet)

hasMember

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

Specified by:
hasMember in class ImmuSet

isEmpty

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

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

isSubsetOf

public boolean isSubsetOf(ScruSet another)
Description copied from class: ScruSet
Whether another currently has all my elements

Overrides:
isSubsetOf in class ScruSet

count

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

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

Specified by:
stepper in class ImmuSet

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 ScruSet

intersect

public ImmuSet intersect(ScruSet another)
Description copied from class: ImmuSet
Regular set intersection. Return an ImmuSet containing only those objects which are members of both sets

Specified by:
intersect in class ImmuSet

minus

public ImmuSet minus(ScruSet another)
Description copied from class: ImmuSet
Return an ImmuSet containing those of my members which aren't members of 'another'

Specified by:
minus in class ImmuSet

unionWith

public ImmuSet unionWith(ScruSet another)
Description copied from class: ImmuSet
Return an ImmuSet containing those objects with are members of either of us

Specified by:
unionWith in class ImmuSet

with

public ImmuSet with(Heaper anElement)
Description copied from class: ImmuSet
'set->with (anElement)' means the same as 'set->unionWith (immuSet (anElement))'. It returns an ImmuSet with all my members and having anElement as a member. If anElement is a member of me, then the result is identical to me.

Specified by:
with in class ImmuSet

without

public ImmuSet without(Heaper anElement)
Description copied from class: ImmuSet
'set->without (anElement)' means the same as 'set->minus (immuSet (anElement))'. It returns an ImmuSet with all my members except anElement. If anElement isn't already a member, then the result is identical to me.

Specified by:
without in class ImmuSet

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.

Specified by:
asMuSet in class ImmuSet

destruct

public void destruct()
Overrides:
destruct in class Heaper

sendSelfTo

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


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