|
||||||||
| 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.steppers.Accumulator
|
+--org.abora.white.collection.sets.SetAccumulator
A SetAccumulator accumulates a bunch of objects and then makes an ImmuSet containing all the accumulated objects. Several people have observed that a SetAccumulator doesn't buy you much because instead you could just store into a MuSet. While this is true (and is in fact how SetAccumulator is trivially implemented), my feeling is that if what a loop is doing is enumerating a bunch of elements from which a Set is to be formed, using a SetAccumulator in the loops says this more clearly to readers of the code.
| Field Summary | |
protected MuSet |
muSet
|
| Constructor Summary | |
protected |
SetAccumulator()
|
protected |
SetAccumulator(Rcvr receiver)
|
protected |
SetAccumulator(ScruSet initialSet)
|
| Method Summary | |
Accumulator |
copy()
Return a new Accumulator just like the current one, except that from now on they accumulate separately |
static SetAccumulator |
make()
Make a SetAccumulator which starts out with no elements accumulated |
static SetAccumulator |
make(ScruSet initialSet)
Make a new SetAccumulator in which all the current elements of initialSet are already accumulated. |
void |
sendSelfTo(Xmtr xmtr)
|
void |
step(Heaper someObj)
Accumulate a new object into the Accumulator |
Heaper |
value()
Return the object that results from accumulating all those objects |
| Methods inherited from class org.abora.white.collection.steppers.Accumulator |
actualHashForEqual, isEqual, ptrArray |
| Methods inherited from class org.abora.white.xpp.basic.Heaper |
destroy, destruct, equals, hashForEqual, printContentsOn, printOn, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected MuSet muSet
| Constructor Detail |
protected SetAccumulator()
protected SetAccumulator(ScruSet initialSet)
protected SetAccumulator(Rcvr receiver)
| Method Detail |
public static SetAccumulator make()
public static SetAccumulator make(ScruSet initialSet)
public void step(Heaper someObj)
Accumulator
step in class Accumulatorpublic Heaper value()
Accumulator
value in class Accumulatorpublic Accumulator copy()
Accumulator
copy in class Accumulatorpublic void sendSelfTo(Xmtr xmtr)
sendSelfTo in class Heaper
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||