|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.white.xpp.basic.Heaper
|
+--org.abora.white.collection.sets.ScruSet
|
+--org.abora.white.collection.sets.ImmuSet
ImmuSets are ScruSets which are guaranteed never to change. ImmuSets correspond to the mathematical notion of a finite set of elements, except of course that here the elements can be any valid X++ object. Just like mathematical sets, two are equal (according to isEqual) iff they have the same elements. Just because the set cannot change, that doesn't prevent any of the members from undergoing state change.
ImmuSets implement some additional protocol to make new sets out of old ones according to the familiar set theoretic operators (like intersect). XuRegions are much like ImmuSets of Positions except that they aren't necessarily finite or even enumerable. XuRegions implement a similar protocol, but aren't polymorphic with ImmuSets.
| Field Summary | |
protected static ImmuSet |
EmptySet
|
| Constructor Summary | |
protected |
ImmuSet()
|
protected |
ImmuSet(Rcvr rcvr)
|
| Method Summary | |
int |
actualHashForEqual()
Defined by subclasses to produce the value returned by hashForEqual. |
ImmuSet |
asImmuSet()
Return an immu snapshot of my current state. |
abstract MuSet |
asMuSet()
Return a Mu whose initial state is the same as my current state, but which will now deviate independently of me. |
ScruSet |
copy()
don't need to actually make a copy, as this is immutable |
abstract IntegerValue |
count()
How many elements are currently in the set. |
protected static ImmuSet |
from(MuSet set)
This is for ImmuSet subclasses to produce results from temporary MuSets. |
abstract boolean |
hasMember(Heaper someone)
Is someone a member of the set now? |
abstract ImmuSet |
intersect(ScruSet another)
Regular set intersection. |
abstract boolean |
isEmpty()
Return true if this set does not currently have
any elements. |
boolean |
isEqual(Heaper other)
Return true if the two objects are equal. |
static ImmuSet |
make()
|
static ImmuSet |
make(MuSet set)
|
abstract ImmuSet |
minus(ScruSet another)
Return an ImmuSet containing those of my members which aren't members of 'another' |
static ImmuSet |
newWith(Heaper value)
A single element ImmuSet |
abstract Stepper |
stepper()
Returns a stepper which will enumerate all the elements of the set in some unspecified order |
abstract ImmuSet |
unionWith(ScruSet another)
Return an ImmuSet containing those objects with are members of either of us |
abstract ImmuSet |
with(Heaper anElement)
'set->with (anElement)' means the same as 'set->unionWith (immuSet (anElement))'. |
abstract ImmuSet |
without(Heaper anElement)
'set->without (anElement)' means the same as 'set->minus (immuSet (anElement))'. |
| Methods inherited from class org.abora.white.collection.sets.ScruSet |
asArray, contentsEqual, contentsHash, intersects, isSubsetOf, printOn, printOnWithSimpleSyntax, printOnWithSyntax, theOne |
| 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 |
| Field Detail |
protected static ImmuSet EmptySet
| Constructor Detail |
protected ImmuSet()
protected ImmuSet(Rcvr rcvr)
| Method Detail |
protected static ImmuSet from(MuSet set)
public static ImmuSet make()
public static ImmuSet make(MuSet set)
public static ImmuSet newWith(Heaper value)
public abstract boolean hasMember(Heaper someone)
ScruSet
hasMember in class ScruSetpublic abstract boolean isEmpty()
ScruSetthis set does not currently have
any elements.
isEmpty in class ScruSetthis set does not currently have any
elements.public abstract ImmuSet intersect(ScruSet another)
public abstract ImmuSet minus(ScruSet another)
public abstract ImmuSet unionWith(ScruSet another)
public abstract ImmuSet with(Heaper anElement)
public abstract ImmuSet without(Heaper anElement)
public ScruSet copy()
copy in class ScruSetpublic ImmuSet asImmuSet()
ScruSet
asImmuSet in class ScruSetpublic abstract MuSet asMuSet()
ScruSet
asMuSet in class ScruSetpublic abstract IntegerValue count()
ScruSet
count in class ScruSetpublic abstract Stepper stepper()
ScruSet
stepper in class ScruSetpublic int actualHashForEqual()
Heaper
actualHashForEqual in class ScruSetpublic boolean isEqual(Heaper other)
Heaper
isEqual in class ScruSet
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||