|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.abora.gold.java.AboraHeaper
|
+--org.abora.gold.xpp.basic.Heaper
|
+--org.abora.gold.collection.sets.ScruSet
X++ has three basic kinds of collection classes. Tables, Sets and XuRegions. XuRegions
are not-necessarily-discrete collections of positions, and are documented in the space
module. Sets and Tables are both discrete and finite, and similar in many ways. Both
originate in a three-way type distinction between:
ScruX -- The protocol for examining one. I.e., it is *Scru*table
ImmuX -- The contract guarantees that the set or table you''re looking at won''t change
(though the things it contains may change)
MuX -- Additional protocol for changing it.
Concrete classes may be a subclass of any of the above. It makes sense to have a concrete
subclass of ScruX which isn''t a subclass of either MuX or ImmuX when, for example, it
represents a tracking, filtered view of some other set which is itself changing. All
kinds of collection can be iterated over when appropriate using Steppers--our basic
iteration abstraction (see Stepper).
Immu''s are sort of like Stamps -- they represent a particular state a colection can have.
Mu''s are sort of like Berts -- they represent a continuing collection identity which can
change its current state.
Sets are pure collections--their contents are just a set of Heapers. Sets (as opposed to
tables) do not provide any organization of these contents.
| Field Summary |
| 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 | |
ScruSet()
|
|
| Method Summary | |
int |
actualHashForEqual()
|
PtrArray |
asArray()
The elements in the set in an array, in some random order |
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. |
void |
asOrderedCollection()
return all of my elements in an ordered collection for smalltalk MVC hacking |
boolean |
contentsEqual(ScruSet other)
Returns whether the two ScruSets have exactly the same set of elements at the moment. 'a->contentsEqual(b)' is equivalent to 'a->asImmuSet()->isEqual(b->asImmuSet())'. |
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. |
void |
dox(BlockClosure aBlock)
|
boolean |
hasMember(Heaper someone)
Is someone a member of the set now? |
void |
inspect()
|
boolean |
intersects(ScruSet other)
tell whether they have any points in common |
boolean |
isEmpty()
Whether it currently has any elements |
boolean |
isEqual(Heaper other)
Return true if the two objects are equal. |
boolean |
isSubsetOf(ScruSet another)
Whether another currently has all my elements |
void |
printOn(java.io.PrintWriter oo)
|
void |
printOnWithSimpleSyntax(java.io.PrintWriter oo,
java.lang.String open,
java.lang.String sep,
java.lang.String close)
|
void |
printOnWithSyntax(java.io.PrintWriter oo,
java.lang.String open,
java.lang.String sep,
java.lang.String close,
boolean fullPrint)
For example, if we have the set '{a, b, c}' and we print it with 'p->printOnWithSyntax(oo, |
static void |
problems()
A ProblemList for all X++ BLASTs |
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. |
| 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 |
| Constructor Detail |
public ScruSet()
| Method Detail |
public int actualHashForEqual()
actualHashForEqual in class Heaperpublic boolean contentsEqual(ScruSet other)
public int contentsHash()
public boolean hasMember(Heaper someone)
public boolean intersects(ScruSet other)
public boolean isEmpty()
public boolean isEqual(Heaper other)
Heaper
isEqual in class Heaperpublic boolean isSubsetOf(ScruSet another)
public ScruSet copy()
public PtrArray asArray()
public ImmuSet asImmuSet()
public MuSet asMuSet()
public void printOn(java.io.PrintWriter oo)
printOn in class Heaper
public void printOnWithSimpleSyntax(java.io.PrintWriter oo,
java.lang.String open,
java.lang.String sep,
java.lang.String close)
public void printOnWithSyntax(java.io.PrintWriter oo,
java.lang.String open,
java.lang.String sep,
java.lang.String close,
boolean fullPrint)
public IntegerVar count()
public Stepper stepper()
public Heaper theOne()
public void inspect()
inspect in class AboraHeaperpublic void asOrderedCollection()
public void dox(BlockClosure aBlock)
public static void problems()
Heaper
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||