|
||||||||
| 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
|
+--org.abora.white.spaces.integers.IntegerRegion
An IntegerRegion can be thought of as the disjoint union of intervals and inequalities.
The interesting cases to look at are:
The distinctions:
isBoundedLeft". Otherwise it extends
leftwards indefinitely. Similarly, if a non-empty region has a greatest element, then it
"isBoundedRight". Otherwise it extends rightwards indefinitely. (We may figuratively
speak of the region extending towards + or - infinity, but we have purposely avoided
introducing any value which represents an infinity.)
Looking at cases again:
isBoundedLeft" and "isBoundedRight" since it doesn't extent
indenfinitely in either direction. (A danger to watch out for is that
this still has neither a greatest nor a least element).isBoundedRight"isBoundedLeft"isBoundedLeft" and "isBoundedRight"isBoundedLeft" iff doesn''t include a left inequality,isBoundedRight" iff doesn''t include a right inequality.IntegerRegions are immutable.
myTransitions, together with a myTransitionCount of the
the first transitions that should be considered. The count appears to be just a
performance improvement in place of continually requesting the count of myTransition.
myStartsInside indicates whether the first transition points is an entering, or
exiting transition.
Empty Region: myStartsInside = false, myTransitions={}
Full Region: myStartsInside = true, myTransitions={}
Before 10: myStartsInside = true, myTransitions={10}
After 10: myStartsInside = false, myTransitions={10}
Between 5 & 10: myStartsInside = false, myTransitions={5, 10}
Statics cache the Empty and Full regions. There are additionally a number of less obvious statics that are more dynamic, and reflect the assumption that there will be a significant number of consequitive repeated requests for the same regions.
See OrderedRegion.
| Field Summary | |
protected static IntegerRegion |
AllIntegers
|
protected static IntegerRegion |
EmptyIntegerRegion
|
protected static IntegerRegion |
LastAfterRegion
|
protected static IntegerValue |
LastAfterStart
|
protected static IntegerValue |
LastBeforeEnd
|
protected static IntegerRegion |
LastBeforeRegion
|
protected static IntegerRegion |
LastInterval
|
protected static IntegerValue |
LastLeft
|
protected static IntegerValue |
LastRight
|
protected static IntegerValue |
LastSingleton
|
protected static IntegerRegion |
LastSingletonRegion
|
protected boolean |
myStartsInside
|
protected int |
myTransitionCount
|
protected IntegerVarArray |
myTransitions
|
| Constructor Summary | |
protected |
IntegerRegion(boolean startsInside,
int count,
IntegerVarArray transitions)
|
protected |
IntegerRegion(Rcvr receiver)
|
| Method Summary | |
static IntegerRegion |
above(IntegerValue start,
boolean inclusive)
Essential. |
int |
actualHashForEqual()
Defined by subclasses to produce the value returned by hashForEqual. |
Stepper |
actualStepper(OrderSpec order)
Iff I am bounded left am I enumerable in ascending order. |
static IntegerRegion |
after(IntegerValue start)
The region containing all position greater than or equal to start |
static IntegerRegion |
allIntegers()
The full region of this space |
XnRegion |
asSimpleRegion()
Will always return the smallest simple region which contains all my positions |
static IntegerVarArray |
badlyViolatePrivacyOfIntegerRegionTransitions(IntegerRegion reg)
used for an efficiency hack in PointRegion. |
static IntegerRegion |
before(IntegerValue end)
The region of all integers less than end. |
XnRegion |
beforeLast()
the region before the last element of the set. |
static IntegerRegion |
below(IntegerValue stop,
boolean inclusive)
Make a region that contains all integers less than (or equal if inclusive is true) to stop. |
Position |
chooseOne(OrderSpec order)
Essential. |
XnRegion |
compacted()
transform the region into a simple region with left bound 0 (or -inf if unbounded below). |
Mapping |
compactor()
A mapping to transform the region into a simple region with left bound 0 (or -inf if unbounded). |
XnRegion |
complement()
Essential. |
CoordinateSpace |
coordinateSpace()
Essential. |
IntegerValue |
count()
How many positions do I contain? If I am not 'isFinite', then this message will BLAST. |
void |
destroy()
|
ScruSet |
distinctions()
Break it up into a set of non-full distinctions. |
protected IntegerEdgeStepper |
edgeStepper()
Do not send from outside the module. |
boolean |
hasIntMember(IntegerValue key)
Unboxed version. |
boolean |
hasMember(Position pos)
Do I contain this position? More than anything else, the behavior of this message is the defining characteristic of an XuRegion. |
static IntegerRegion |
integerExtent(IntegerValue start,
IntegerValue n)
The region of all integers which are >= start and < start + n |
XnRegion |
intersect(XnRegion region)
Essential. |
boolean |
intersects(XnRegion region)
Essential. |
static IntegerRegion |
interval(IntegerValue left,
IntegerValue right)
The region of all integers which are >= left and < right |
Stepper |
intervals()
|
Stepper |
intervals(OrderSpec order)
Essential. |
boolean |
isBoundedAbove()
Either I extend indefinitely to plus infinity, or I am bounded above, not both. |
boolean |
isBoundedBelow()
Either I extend indefinitely to minus infinity, or I am bounded below, not both. |
boolean |
isCompacted()
Return true if this region is either empty or a simple region
with lower bound of either 0 or -infinity. |
boolean |
isEmpty()
Every coordinate space has exactly one empty region. |
boolean |
isEnumerable(OrderSpec order)
Actually uses the ' order' argument correctly to enumerate the
positions. |
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 |
isInterval()
Whether this Region is a non-empty interval, i.e. |
boolean |
isSimple()
Inequalities and intervals are both simple. |
boolean |
isSubsetOf(XnRegion other)
I'm a subset of other if I don't have any positions that he doesn't. |
static IntegerRegion |
make()
No integers, the empty region |
static IntegerRegion |
make(IntegerValue singleton)
The region with just this one position. |
static IntegerRegion |
make(IntegerValue left,
IntegerValue right)
The region of all integers which are >= left and < right. |
IntegerValue |
nearestIntHole(IntegerValue index)
This is a hack for finding the smallest available index to allocate that is not in a particular region (a table domain, for example). |
void |
printOn(java.io.PrintWriter oo)
This should rarely be overridden. |
IntegerRegion |
runAt(IntegerValue pos)
Return the region starting from pos (inclusive) and going until the next transition. |
protected IntegerVarArray |
secretTransitions()
The actuall array. |
void |
sendSelfTo(Xmtr xmtr)
|
protected IntegerRegion |
simpleRegionAtIndex(int i)
the simple region at the given index in the transition array |
Stepper |
simpleRegions(OrderSpec order)
Treats NULL the same as ascending. |
XnRegion |
simpleUnion(XnRegion otherRegion)
The result is the smallest simple region which satisfies the spec in XuRegion::simpleUnion |
IntegerValue |
start()
I have a start only if I'm not empty and I am isBoundedBelow. |
IntegerValue |
stop()
I have a stop only if I'm not empty and I am isBoundedAbove. |
protected int |
transitionCount()
Do not send from outside the module. |
XnRegion |
unionWith(XnRegion region)
The result has as members exactly those positions which are members of either of the original two regions. |
protected static IntegerRegion |
usingx(boolean startsInside,
int transitionCount,
IntegerVarArray transitions)
|
XnRegion |
with(Position position)
the region with one more position. |
XnRegion |
withInt(IntegerValue pos)
|
| Methods inherited from class org.abora.white.spaces.basic.XnRegion |
chooseMany, chooseMany, chooseOne, delta, disjointSimpleRegions, disjointSimpleRegions, immuSet, isDistinction, isEnumerable, minus, simpleRegions, stepper, stepper, theOne, without |
| Methods inherited from class org.abora.white.xpp.basic.Heaper |
destruct, equals, hashForEqual, printContentsOn, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final boolean myStartsInside
protected final int myTransitionCount
protected final IntegerVarArray myTransitions
protected static IntegerRegion AllIntegers
protected static IntegerRegion EmptyIntegerRegion
protected static IntegerRegion LastAfterRegion
protected static IntegerValue LastAfterStart
protected static IntegerValue LastBeforeEnd
protected static IntegerRegion LastBeforeRegion
protected static IntegerRegion LastInterval
protected static IntegerValue LastLeft
protected static IntegerValue LastRight
protected static IntegerValue LastSingleton
protected static IntegerRegion LastSingletonRegion
| Constructor Detail |
protected IntegerRegion(boolean startsInside,
int count,
IntegerVarArray transitions)
protected IntegerRegion(Rcvr receiver)
| Method Detail |
protected static IntegerRegion usingx(boolean startsInside,
int transitionCount,
IntegerVarArray transitions)
public static IntegerRegion above(IntegerValue start,
boolean inclusive)
public static IntegerRegion after(IntegerValue start)
public static IntegerRegion allIntegers()
public static IntegerRegion before(IntegerValue end)
public static IntegerRegion below(IntegerValue stop,
boolean inclusive)
public static IntegerRegion integerExtent(IntegerValue start,
IntegerValue n)
public static IntegerRegion interval(IntegerValue left,
IntegerValue right)
public static IntegerRegion make()
public static IntegerRegion make(IntegerValue singleton)
public static IntegerRegion make(IntegerValue left,
IntegerValue right)
public static IntegerVarArray badlyViolatePrivacyOfIntegerRegionTransitions(IntegerRegion reg)
public XnRegion asSimpleRegion()
asSimpleRegion in class XnRegionpublic XnRegion beforeLast()
What on earth is this for? (Yes, I've looked at senders)
public XnRegion compacted()
What on earth is this for? (Yes, I've looked at senders)
public Mapping compactor()
This is primarily used in XuText Waldos, which only deal with contiguous zero-based regions of data.
public CoordinateSpace coordinateSpace()
XnRegion
coordinateSpace in class XnRegionpublic boolean isCompacted()
this region is either empty or a simple region
with lower bound of either 0 or -infinity.
Equivalent to this->compacted()->isEqual (this)
public IntegerValue nearestIntHole(IntegerValue index)
public IntegerRegion runAt(IntegerValue pos)
this contains
pos, then return the longest contiguous region starting at pos of positions it contains.
If this don't contain pos, then return the longest contiguous region starting at pos of
positions it does not contain.
public IntegerValue start()
public IntegerValue stop()
public void destroy()
destroy in class Heaperpublic void printOn(java.io.PrintWriter oo)
Heaper
printOn in class Heaperpublic int actualHashForEqual()
Heaper
actualHashForEqual in class XnRegionpublic boolean hasIntMember(IntegerValue key)
public boolean hasMember(Position pos)
XnRegion
hasMember in class XnRegionpublic boolean intersects(XnRegion region)
XnRegion
intersects in class XnRegionpublic boolean isBoundedAbove()
public boolean isBoundedBelow()
public 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()
isSimple in class XnRegionpublic boolean isSubsetOf(XnRegion other)
XnRegion
isSubsetOf in class XnRegionpublic XnRegion complement()
XnRegion
complement in class XnRegionpublic XnRegion intersect(XnRegion region)
XnRegion
intersect in class XnRegionpublic XnRegion simpleUnion(XnRegion otherRegion)
simpleUnion in class XnRegionpublic XnRegion unionWith(XnRegion region)
XnRegion
unionWith in class XnRegionpublic XnRegion with(Position position)
XnRegion
with in class XnRegionpublic XnRegion withInt(IntegerValue pos)
public Stepper intervals()
public IntegerValue count()
XnRegion
count in class XnRegionpublic Stepper intervals(OrderSpec order)
public boolean isEnumerable(OrderSpec order)
order' argument correctly to enumerate the
positions. Treats null the same as ascending. Iff I am bounded left
am I enumerable in ascending order. Similarly, only if I am bounded
right am I enumerable in descending order.
isEnumerable in class XnRegionpublic boolean isInterval()
public ScruSet distinctions()
XnRegion
distinctions in class XnRegionpublic Stepper simpleRegions(OrderSpec order)
simpleRegions in class XnRegionprotected IntegerVarArray secretTransitions()
protected IntegerRegion simpleRegionAtIndex(int i)
protected IntegerEdgeStepper edgeStepper()
protected int transitionCount()
public Position chooseOne(OrderSpec order)
XnRegion
chooseOne in class XnRegionpublic Stepper actualStepper(OrderSpec order)
actualStepper in class XnRegionpublic void sendSelfTo(Xmtr xmtr)
sendSelfTo in class Heaper
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||