|
||||||||
| 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.spaces.basic.XnRegion
|
+--org.abora.gold.spaces.unordered.SetRegion
How do you make regions for spaces whose positions
a) have no orderring (i.e., either no ordering can be imposed (as
in HeaperSpace) or it is undesirable to impose one (as curently
in IDSpace)); and
b) there is an inifinte supply of new positions, and you can only
name the positions you''ve encountered?
SetRegion is our answer to that. To start with, a set region can simply be an enumeration
of the positions which are its members. However, because the complement of an XuRegion
must be a valid XuRegion, and we have no other representation of the infinite set of
positions left over, we must also be able to represent the region consisting of all
positions except those explicitly enumerated. Every SetRegion must either have a finite
number of positions, or it must cover all the space except for a finite number of
positions.
With regard to degrees of simplicity (see class comment in XuRegion), we currently only
have distinctions. There are no non-distinctions, and therefore no non-simple SetRegions.
Interesting cases are:
1) empty region
2) full region
3) singleton set (single member)
4) singleton hole (single non-member)
5) region with more than 1, but a finite number, of members
6) region with more than 1, but a finite number, of non-members
Cases 1, 3, and 5 can be considered the "positive" regions, and cases 2, 4, and 6 the
"negative" ones.
Because we only have distinctions (which we are currently doing for an internal reason
which will probably go away), we forego the ability to use the generic XuRegion protocol
to decompose complex regions into simpler ones. Instead we provide SetRegion specific
protocol ("positions" and "isComplement").
At a later time, we will probably have cases 1 thru 4 above be the only distinctions, case
6 be a simple region but not a distinction, and have case 5 be a non-simple region.
(These choices are all consistent with the letter and spirit of the simplicity framework
documented in XuRegion. Simple regions must be the *intersection* of distinctions,
therefore case 5 cannot be a simple non-distinction.) Please try to write your software
so that it''ll be insensitive to this change. Thanks.
SetRegion is an abstract superclass useful for defining regions for spaces which have the
constraints listed above.
| Field Summary | |
protected boolean |
myIsComplement
|
protected ImmuSet |
myPositions
|
| Fields inherited from class org.abora.gold.spaces.basic.XnRegion |
CantMixCoordSpacesSignal, EmptyRegionSignal |
| 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 | |
SetRegion(boolean cmp,
ImmuSet set)
the set should be for my use alone |
|
SetRegion(Rcvr receiver)
|
|
| Method Summary | |
int |
actualHashForEqual()
|
Stepper |
actualStepper(OrderSpec order)
Only called if I've already said I'm enumerable in the originally stated order. |
XnRegion |
asSimpleRegion()
Return a simple region containing all positions contained by myself. If I am simple, then the result must be me. |
XnRegion |
complement()
Essential. |
CoordinateSpace |
coordinateSpace()
Essential. |
IntegerVar |
count()
How many positions do I contain? If I am not 'isFinite', then this message will BLAST. |
ScruSet |
distinctions()
Break it up into a set of non-full distinctions. |
boolean |
hasMember(Position atPos)
Do I contain this position? More than anything else, the behavior of this message is the defining characteristic of an XuRegion. |
XnRegion |
intersect(XnRegion region)
Essential. |
boolean |
intersects(XnRegion region)
Essential. |
boolean |
isComplement()
FALSE means that I'm a 'positive' region (see class comment). TRUE means I'm a negative region. |
boolean |
isEmpty()
Every coordinate space has exactly one empty region. |
boolean |
isEnumerable(OrderSpec order)
See comment in XuRegion::stepper. a->stepper(os) won't BLAST iff a->isEnumerable(os) |
boolean |
isEqual(Heaper other)
Two regions are equal iff they contain exactly the same set of positions |
boolean |
isFinite()
Essential. |
boolean |
isFull()
true if this is the largest possible region in this space -- the region that contains all positions in the space. |
boolean |
isSimple()
Am I a simple region. |
boolean |
isSubsetOf(XnRegion other)
I'm a subset of other if I don't have any positions that he doesn't. |
XnRegion |
makeNew(boolean isComplement,
ImmuSet positions)
|
XnRegion |
minus(XnRegion other)
The region containing all my position which aren't in other. |
ImmuSet |
positions()
If I'm a positive region (see class comment and isComplement), then this is a list of those positions I contain. |
void |
printOn(java.io.PrintWriter oo)
|
void |
sendSelfTo(Xmtr xmtr)
do nothing |
Stepper |
simpleRegions(OrderSpec order)
Make up a singleton set containing the whole region |
XnRegion |
simpleUnion(XnRegion other)
The result must contain all positions contained by either of the two original regions, and the result must be simple. |
Position |
theOne()
Iff I contain exactly one position, return it. |
XnRegion |
unionWith(XnRegion region)
The result has as members exactly those positions which are members of either of the original two regions. |
XnRegion |
with(Position pos)
the region with one more position. |
XnRegion |
without(Position pos)
the region with one less position. |
| Methods inherited from class org.abora.gold.spaces.basic.XnRegion |
asArray, chooseMany, chooseMany, chooseOne, chooseOne, delta, disjointSimpleRegions, disjointSimpleRegions, dox, immuSet, info, isDistinction, isEnumerable, mapping, simpleRegions, stepper, stepper |
| Methods inherited from class org.abora.gold.java.AboraHeaper |
asOop, basicInspect, displayString, error, hack, halt, inspect, 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 |
| Field Detail |
protected ImmuSet myPositions
protected boolean myIsComplement
| Constructor Detail |
public SetRegion(boolean cmp,
ImmuSet set)
public SetRegion(Rcvr receiver)
| Method Detail |
public XnRegion asSimpleRegion()
XnRegion
asSimpleRegion in class XnRegionpublic ScruSet distinctions()
XnRegion
distinctions in class XnRegionpublic boolean isComplement()
public ImmuSet positions()
public Stepper simpleRegions(OrderSpec order)
simpleRegions in class XnRegionpublic IntegerVar count()
XnRegion
count in class XnRegionpublic boolean isEnumerable(OrderSpec order)
XnRegion
isEnumerable in class XnRegionpublic Position theOne()
XnRegion
theOne in class XnRegionpublic XnRegion complement()
XnRegion
complement in class XnRegionpublic XnRegion intersect(XnRegion region)
XnRegion
intersect in class XnRegionpublic XnRegion minus(XnRegion other)
XnRegion
minus in class XnRegionpublic XnRegion simpleUnion(XnRegion other)
XnRegion
simpleUnion in class XnRegionpublic XnRegion unionWith(XnRegion region)
XnRegion
unionWith in class XnRegionpublic XnRegion with(Position pos)
XnRegion
with in class XnRegionpublic XnRegion without(Position pos)
XnRegion
without in class XnRegionpublic int actualHashForEqual()
actualHashForEqual in class XnRegionpublic boolean hasMember(Position atPos)
XnRegion
hasMember in class XnRegionpublic boolean intersects(XnRegion region)
XnRegion
intersects in class XnRegionpublic boolean isEmpty()
XnRegion
isEmpty in class XnRegionpublic boolean isEqual(Heaper other)
XnRegion
isEqual in class XnRegionpublic boolean isFinite()
XnRegion
isFinite in class XnRegionpublic boolean isFull()
XnRegion
isFull in class XnRegionpublic boolean isSimple()
XnRegion
isSimple in class XnRegionpublic boolean isSubsetOf(XnRegion other)
XnRegion
isSubsetOf in class XnRegionpublic void printOn(java.io.PrintWriter oo)
printOn in class Heaper
public XnRegion makeNew(boolean isComplement,
ImmuSet positions)
public CoordinateSpace coordinateSpace()
XnRegion
coordinateSpace in class XnRegionpublic Stepper actualStepper(OrderSpec order)
XnRegion
actualStepper in class XnRegionpublic void sendSelfTo(Xmtr xmtr)
Heaper
sendSelfTo in class Heaper
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||