|
||||||||
| 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.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:
1) The empty region
2) The full region
3) A "left" inequality -- e.g., everything less that 3.
4) A "right" inequality -- e.g., everything greater than or equal to 7
The non-distinction simple regions:
5) An interval -- e.g., from 3 inclusive to 7 exclusive
The non-simple regions:
6) A disjoint union of (in order) an optional left inequality, a set of
intervals, and an optional right inequality.
If a non-empty region has a least element, then it "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:
1) "isBoundedLeft" and "isBoundedRight" since it doesn''t extent
indenfinitely in either direction. (A danger to watch out for is that
this still has niether a greatest nor a least element).
2) niether.
3) "isBoundedRight"
4) "isBoundedLeft"
5) "isBoundedLeft" and "isBoundedRight"
6) "isBoundedLeft" iff doesn''t include a left inequality,
"isBoundedRight" iff doesn''t include a right inequality.
An efficiency note: Currently many of the method which could be doing an O(log) binary
search (such as hasMember) are instead doing a linear search. This will be fixed if it
turns out to be a problem in practice.
See OrderedRegion.
| Field Summary | |
protected static IntegerRegion |
AllIntegers
|
protected static IntegerRegion |
EmptyIntegerRegion
|
protected static IntegerRegion |
LastAfterRegion
|
protected static IntegerVar |
LastAfterStart
|
protected static IntegerVar |
LastBeforeEnd
|
protected static IntegerRegion |
LastBeforeRegion
|
protected static IntegerRegion |
LastInterval
|
protected static IntegerVar |
LastLeft
|
protected static IntegerVar |
LastRight
|
protected static IntegerVar |
LastSingleton
|
protected static IntegerRegion |
LastSingletonRegion
|
protected boolean |
myStartsInside
|
protected int |
myTransitionCount
|
protected IntegerVarArray |
myTransitions
|
| 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 | |
IntegerRegion(boolean startsInside,
int count,
IntegerVarArray transitions)
|
|
IntegerRegion(Rcvr receiver)
|
|
| Method Summary | |
static IntegerRegion |
above(IntegerVar start,
boolean inclusive)
Essential. |
int |
actualHashForEqual()
|
Stepper |
actualStepper(OrderSpec order)
Iff I am bounded left am I enumerable in ascending order. |
static IntegerRegion |
after(IntegerVar 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(IntegerVar end)
The region of all integers less than end. |
XnRegion |
beforeLast()
the region before the last element of the set. What on earth is this for? (Yes, I've looked at senders) |
static IntegerRegion |
below(IntegerVar 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). What on earth is this for? (Yes, I've looked at senders) |
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. |
IntegerVar |
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. |
IntegerEdgeStepper |
edgeStepper()
Do not send from outside the module. |
boolean |
hasIntMember(IntegerVar 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 void |
info()
{Stepper CLIENT of: RealRegion} intervals: order {OrderSpec default: NULL} {BooleanVar CLIENT} isBoundedAbove {BooleanVar CLIENT} isBoundedBelow {BooleanVar CLIENT} isInterval {IntegerVar CLIENT} start {IntegerVar CLIENT} stop |
static void |
initTimeNonInherited()
|
static IntegerRegion |
integerExtent(IntegerVar start,
IntegerVar 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(IntegerVar left,
IntegerVar 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. The empty region is bounded above despite the fact that it has no upper edge. |
boolean |
isBoundedBelow()
Either I extend indefinitely to minus infinity, or I am bounded below, not both. The empty region is bounded below despite the fact that it has no lower bound. |
boolean |
isCompacted()
True if this is either empty or a simple region with lower bound of either 0 or -infinity. Equivalent to this->compacted()->isEqual (this) |
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 void |
linkTimeNonInherited()
|
static Heaper |
make()
No integers, the empty region |
static Heaper |
make(IntegerVar singleton)
The region with just this one position. |
static Heaper |
make(IntegerVar left,
IntegerVar right)
The region of all integers which are >= left and < right |
IntegerVar |
nearestIntHole(IntegerVar 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)
|
IntegerRegion |
runAt(IntegerVar pos)
The region starting from pos (inclusive) and going until the next transition. |
IntegerVarArray |
secretTransitions()
The actuall array. |
void |
sendSelfTo(Xmtr xmtr)
do nothing |
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 |
IntegerVar |
start()
I have a start only if I'm not empty and I am isBoundedBelow. |
boolean |
startsInside()
|
IntegerVar |
stop()
I have a stop only if I'm not empty and I am isBoundedAbove. |
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. |
static IntegerRegion |
usingx(boolean startsInside,
int transitionCount,
IntegerVarArray transitions)
|
XnRegion |
with(Position position)
the region with one more position. |
XnRegion |
withInt(IntegerVar pos)
|
| Methods inherited from class org.abora.gold.spaces.basic.XnRegion |
asArray, chooseMany, chooseMany, chooseOne, delta, disjointSimpleRegions, disjointSimpleRegions, dox, immuSet, isDistinction, isEnumerable, mapping, minus, simpleRegions, stepper, stepper, theOne, without |
| 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 boolean myStartsInside
protected int myTransitionCount
protected IntegerVarArray myTransitions
protected static IntegerRegion AllIntegers
protected static IntegerRegion EmptyIntegerRegion
protected static IntegerRegion LastAfterRegion
protected static IntegerVar LastAfterStart
protected static IntegerVar LastBeforeEnd
protected static IntegerRegion LastBeforeRegion
protected static IntegerRegion LastInterval
protected static IntegerVar LastLeft
protected static IntegerVar LastRight
protected static IntegerVar LastSingleton
protected static IntegerRegion LastSingletonRegion
| Constructor Detail |
public IntegerRegion(boolean startsInside,
int count,
IntegerVarArray transitions)
public IntegerRegion(Rcvr receiver)
| Method Detail |
public XnRegion asSimpleRegion()
asSimpleRegion in class XnRegionpublic XnRegion beforeLast()
public XnRegion compacted()
public Mapping compactor()
public CoordinateSpace coordinateSpace()
XnRegion
coordinateSpace in class XnRegionpublic boolean isCompacted()
public IntegerVar nearestIntHole(IntegerVar index)
public IntegerRegion runAt(IntegerVar pos)
public IntegerVar start()
public IntegerVar stop()
public void destroy()
destroy in class Heaperpublic void printOn(java.io.PrintWriter oo)
printOn in class Heaperpublic int actualHashForEqual()
actualHashForEqual in class XnRegionpublic boolean hasIntMember(IntegerVar 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(IntegerVar pos)
public Stepper intervals()
public IntegerVar count()
XnRegion
count in class XnRegionpublic Stepper intervals(OrderSpec order)
public boolean isEnumerable(OrderSpec order)
isEnumerable in class XnRegionpublic boolean isInterval()
public ScruSet distinctions()
XnRegion
distinctions in class XnRegionpublic Stepper simpleRegions(OrderSpec order)
simpleRegions in class XnRegionpublic IntegerVarArray secretTransitions()
public IntegerRegion simpleRegionAtIndex(int i)
public IntegerEdgeStepper edgeStepper()
public int transitionCount()
public Position chooseOne(OrderSpec order)
XnRegion
chooseOne in class XnRegionpublic boolean startsInside()
public Stepper actualStepper(OrderSpec order)
actualStepper in class XnRegionpublic void sendSelfTo(Xmtr xmtr)
Heaper
sendSelfTo in class Heaper
public static IntegerRegion above(IntegerVar start,
boolean inclusive)
public static IntegerRegion after(IntegerVar start)
public static IntegerRegion allIntegers()
public static IntegerRegion before(IntegerVar end)
public static IntegerRegion below(IntegerVar stop,
boolean inclusive)
public static IntegerRegion integerExtent(IntegerVar start,
IntegerVar n)
public static IntegerRegion interval(IntegerVar left,
IntegerVar right)
public static Heaper make()
public static Heaper make(IntegerVar singleton)
public static Heaper make(IntegerVar left,
IntegerVar right)
public static void initTimeNonInherited()
public static void linkTimeNonInherited()
public static IntegerVarArray badlyViolatePrivacyOfIntegerRegionTransitions(IntegerRegion reg)
public static IntegerRegion usingx(boolean startsInside,
int transitionCount,
IntegerVarArray transitions)
public static void info()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||