|
||||||||
| 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.spaces.basic.XnRegion
The design of a new coordinate space consists mostly in the design of the XuRegions which can be used to describe (possibly infinite) sets of positions in that coordinate space. It will generally not be the case (for a given coordinate space) that all mathematically describable sets of positions will be representable by an XuRegion in that space. This should not be seen as a temporary deficiency of the current implementation of a space, but rather part of the design of what a given space means.
For example, in IntegerSpace, one cannot form the XuRegion whose members are exactly the even numbers. If this were possible, other desirable properties which are part of the intent of IntegerSpaces would no longer be possible. For example, any XuRegion should be able to break itself up into a finite number of simple XuRegions ("simple" is described below). Were an even number region possible, this would have undesirable consequences for the definition of "simple" in this space. If you want (for example) to be able to have a XuRegion which can represent all the even numbers, it probably makes more sense to define a whole new space in which these new XuRegions apply.
XuRegions should be closed under a large set of operations, such as intersection, unionWith, complement and minus. ("closed" means that the result of performing this operation on XuRegions of a given space is another valid XuRegion in the same space.) Additional guarantees are documented with each operation.
A XuRegion may be classified at one of three levels of "simplicity":
distinctions". (The reason
I say "at most" is that a full region (one that covers the entire coordinate space) may
answer with the empty set.) Distinctions are the simplest XuRegions of a given space out
of which all other XuRegions of that space can be finitely composed. There should
probably be a message "isDistinction" for which exactly the distinctions answer "true".
The complement of a distinction is a distinction. Three examples of distinctions in
spaces are:
true" to
"isSimple". All distinctions are also simple regions. In response to the message
"distinctions", and simple region must return a finite set of distinctions which, when
intersected together, yield the original simple region. Generally, one tries to define
the simple regions for a space to correspond to some notion of locality in the space. For
example, it may be good for a simple region not to be able to have a hole in it. Or
perhaps a simple region is which must be connected (whatever that means in a given space).
Example non-distinction simple regions for the above example spaces would be:
simpleRegions" with a stepper which will produce a finite number of simple
regions that, when unioned together, yields the original region. A simple region will
return a stepper that will return at most itself ("at most" because an empty region (which
covers no positions) may return an empty stepper). Example non-simple regions are:
| Constructor Summary | |
protected |
XnRegion()
|
protected |
XnRegion(Rcvr rcvr)
|
| Method Summary | |
int |
actualHashForEqual()
Defined by subclasses to produce the value returned by hashForEqual. |
abstract 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. |
XnRegion |
chooseMany(IntegerValue n)
|
XnRegion |
chooseMany(IntegerValue n,
OrderSpec order)
If an OrderSpec is given, return the first n elements according to that OrderSpec. |
Position |
chooseOne()
|
Position |
chooseOne(OrderSpec order)
Essential. |
abstract XnRegion |
complement()
Essential. |
abstract CoordinateSpace |
coordinateSpace()
Essential. |
abstract IntegerValue |
count()
How many positions do I contain? If I am not 'isFinite', then this message will BLAST. |
XnRegion |
delta(XnRegion region)
The region where they differ. |
Stepper |
disjointSimpleRegions()
emulate default argument of NULL |
Stepper |
disjointSimpleRegions(OrderSpec order)
break it up into a set of non-empty simple regions which don't overlap. |
abstract ScruSet |
distinctions()
Break it up into a set of non-full distinctions. |
abstract 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. |
static ImmuSet |
immuSet(XnRegion region)
Make a set containing all the positions in the region |
abstract XnRegion |
intersect(XnRegion other)
Essential. |
boolean |
intersects(XnRegion other)
Essential. |
boolean |
isDistinction()
Am I a distinction. |
abstract boolean |
isEmpty()
Every coordinate space has exactly one empty region. |
boolean |
isEnumerable()
emulate default argument of NULL |
abstract boolean |
isEnumerable(OrderSpec order)
See comment in XuRegion::stepper. |
abstract boolean |
isEqual(Heaper other)
Two regions are equal iff they contain exactly the same set of positions |
abstract 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. |
abstract 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 |
minus(XnRegion other)
The region containing all my position which aren't in other. |
Stepper |
simpleRegions()
emulate default argument of NULL |
abstract Stepper |
simpleRegions(OrderSpec order)
Break myself up into a finite set of non-empty simple regions which, when unionWith'ed together will yield me. |
abstract XnRegion |
simpleUnion(XnRegion other)
The result must contain all positions contained by either of the two original regions, and the result must be simple. |
Stepper |
stepper()
emulate default argument of NULL |
Stepper |
stepper(OrderSpec order)
Essential. |
Position |
theOne()
Iff I contain exactly one position, return it. |
abstract XnRegion |
unionWith(XnRegion other)
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.white.xpp.basic.Heaper |
destroy, destruct, equals, hashForEqual, printContentsOn, printOn, sendSelfTo, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected XnRegion()
protected XnRegion(Rcvr rcvr)
| Method Detail |
public static ImmuSet immuSet(XnRegion region)
public XnRegion asSimpleRegion()
public abstract CoordinateSpace coordinateSpace()
public abstract XnRegion complement()
public XnRegion delta(XnRegion region)
a->delta(b) ->isEqual (a->minus(b)->unionWith(b->minus(a)))
public abstract XnRegion intersect(XnRegion other)
public XnRegion minus(XnRegion other)
public abstract XnRegion simpleUnion(XnRegion other)
a->simpleUnion(b) satisfies the same specification
as (a->unionWith(b))->asSimpleRegion(). However, the two results do
not have to be the same region.
public abstract XnRegion unionWith(XnRegion other)
public XnRegion with(Position pos)
public XnRegion without(Position pos)
public int actualHashForEqual()
Heaper
actualHashForEqual in class Heaperpublic abstract boolean hasMember(Position atPos)
public boolean intersects(XnRegion other)
public boolean isDistinction()
public abstract boolean isEmpty()
public abstract boolean isEqual(Heaper other)
isEqual in class Heaperpublic abstract boolean isFinite()
public boolean isFull()
public abstract boolean isSimple()
public boolean isSubsetOf(XnRegion other)
public XnRegion chooseMany(IntegerValue n)
public Position chooseOne()
public Stepper disjointSimpleRegions()
public boolean isEnumerable()
public Stepper simpleRegions()
public Stepper stepper()
public XnRegion chooseMany(IntegerValue n,
OrderSpec order)
public Position chooseOne(OrderSpec order)
public abstract IntegerValue count()
public Stepper disjointSimpleRegions(OrderSpec order)
public abstract ScruSet distinctions()
public abstract Stepper simpleRegions(OrderSpec order)
public Stepper stepper(OrderSpec order)
public Position theOne()
public abstract Stepper actualStepper(OrderSpec order)
public abstract boolean isEnumerable(OrderSpec order)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||