org.abora.white.spaces.cross
Class CrossRegion

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.spaces.basic.XnRegion
              |
              +--org.abora.white.spaces.cross.CrossRegion
Direct Known Subclasses:
GenericCrossRegion

public abstract class CrossRegion
extends XnRegion

A cross region is a distinction if 1) it is empty, 2) it is full, or 3) it is the rectangular cross of full regions and one distinction. Note that case 3 actually subsumes 1 and 2. Since the simple regions of a space are the intersections of a finite number of distinctions of a space, this implies that A cross region is simple if it is the rectangular cross of simple regions. In other words, a simple region is identical to the cross of its projections.


Constructor Summary
protected CrossRegion()
           
protected CrossRegion(Rcvr rcvr)
           
 
Method Summary
 int actualHashForEqual()
          To avoid overly burdensome canonicalization rules, my hash is calculated from the hash of my projections
abstract  Stepper actualStepper(OrderSpec order)
          Only called if I've already said I'm enumerable in the originally stated order.
abstract  XnRegion asSimpleRegion()
          Return a simple region containing all positions contained by myself.
abstract  Stepper boxes()
          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.
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 void info()
          {Stepper CLIENT of: CrossRegion} boxes {BooleanVar CLIENT} isBox {XuRegion CLIENT} projection: index {Int32} {PtrArray CLIENT of: XuRegion} projections
abstract  XnRegion intersect(XnRegion other)
          Essential.
abstract  boolean isBox()
          Whether this Region is a box, i.e.
abstract  boolean isEmpty()
          Every coordinate space has exactly one empty region.
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.
abstract  boolean isSimple()
          Am I a simple region.
 XnRegion projection(int index)
          The answer is the projection of this region into the specified dimension of the cross space
abstract  PtrArray projections()
          Essential.
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.
 XnRegion simpleUnion(XnRegion other)
          The result must contain all positions contained by either of the two original regions, and the result must be simple.
abstract  XnRegion unionWith(XnRegion other)
          The result has as members exactly those positions which are members of either of the original two regions.
 
Methods inherited from class org.abora.white.spaces.basic.XnRegion
chooseMany, chooseMany, chooseOne, chooseOne, delta, disjointSimpleRegions, disjointSimpleRegions, immuSet, intersects, isDistinction, isEnumerable, isFull, isSubsetOf, minus, simpleRegions, stepper, stepper, theOne, with, without
 
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

CrossRegion

protected CrossRegion()

CrossRegion

protected CrossRegion(Rcvr rcvr)
Method Detail

actualHashForEqual

public int actualHashForEqual()
To avoid overly burdensome canonicalization rules, my hash is calculated from the hash of my projections

Overrides:
actualHashForEqual in class XnRegion

hasMember

public abstract boolean hasMember(Position atPos)
Description copied from class: XnRegion
Do I contain this position? More than anything else, the behavior of this message is the defining characteristic of an XuRegion. All other messages (except for the simplicity characterization) should be specifiable in terms of the behavior of this message. What an XuRegion *is* (mostly) is a finite decision procedure for accepting or rejecting any given position.

Specified by:
hasMember in class XnRegion

isEmpty

public abstract boolean isEmpty()
Description copied from class: XnRegion
Every coordinate space has exactly one empty region. It is the one containing no positions. It and only it responds 'true' to this message.

Specified by:
isEmpty in class XnRegion

isEnumerable

public abstract boolean isEnumerable(OrderSpec order)
Description copied from class: XnRegion
See comment in XuRegion::stepper. a->stepper(os) won't BLAST iff a->isEnumerable(os)

Specified by:
isEnumerable in class XnRegion

isEqual

public abstract boolean isEqual(Heaper other)
Description copied from class: XnRegion
Two regions are equal iff they contain exactly the same set of positions

Specified by:
isEqual in class XnRegion

isFinite

public abstract boolean isFinite()
Description copied from class: XnRegion
Essential. Do I contain a finite number of positions? If I do, then the 'count' message will say how many, and I will gladly provide a stepper which will step over all of them. I.e., isFinite implies isEnumerable.

Specified by:
isFinite in class XnRegion

isSimple

public abstract boolean isSimple()
Description copied from class: XnRegion
Am I a simple region. See XuRegion class comment for implications of being simple.

Specified by:
isSimple in class XnRegion

boxes

public abstract Stepper boxes()
Essential. Divide this Region up into a disjoint sequence of boxes. A box is a region which is the cross of its projections.


count

public abstract IntegerValue count()
Description copied from class: XnRegion
How many positions do I contain? If I am not 'isFinite', then this message will BLAST.

Specified by:
count in class XnRegion

distinctions

public abstract ScruSet distinctions()
Description copied from class: XnRegion
Break it up into a set of non-full distinctions. It is an error to send this to a non-simple region. A full region will respond with the null set. Other distinctions will respond with a singleton set containing themselves, and simple regions will respond with a set of distinctions which, when intersected together, yield the original region.

Specified by:
distinctions in class XnRegion

isBox

public abstract boolean isBox()
Whether this Region is a box, i.e. is equal to the cross of its projections.


simpleRegions

public abstract Stepper simpleRegions(OrderSpec order)
Description copied from class: XnRegion
Break myself up into a finite set of non-empty simple regions which, when unionWith'ed together will yield me. May be sent to any region. If I am isEmpty, I will respond with the empty stepper. Otherwise, if I am simple I will respond with a stepper producing just myself. Please only use NULL for the 'order' argument for now unless the documentation for a particular region or coordinate space says that it will deal with the 'order' argument meaningfully. When no order is specified then I may return the simple regions in any order. When the ordering functionality is implemented, then I am constrained to produce the simple regions in an order consistent with the argument's ordering of my positions. When the simple regions don't overlap, and don't surround each other in the ordering, then the meaning is clear. Otherwise, there are several plausible options for how we should specify this message.

Specified by:
simpleRegions in class XnRegion

asSimpleRegion

public abstract XnRegion asSimpleRegion()
Description copied from class: XnRegion
Return a simple region containing all positions contained by myself. If I am simple, then the result must be me. Otherwise, the resulting region will contain more positions than I do, but it must contain all those that I do. It would be good for the resulting simple region to not contain many more points than it needs in order to satisfy these constraints; but this is a preference, not a specification. Particular spaces may specify stronger guarantees, but as far as class XuRegion is concerned it is correct (though silly) for this message to always return the full region for the space.

Overrides:
asSimpleRegion in class XnRegion

complement

public abstract XnRegion complement()
Description copied from class: XnRegion
Essential. Return a region of containing exactly those positions not in this region. The complement of a distinction must be a distinction.

Specified by:
complement in class XnRegion

intersect

public abstract XnRegion intersect(XnRegion other)
Description copied from class: XnRegion
Essential. The intersection of two simple regions must be simple. The intersection of two distinctions must therefore be a simple region. The result has exactly those members which both the original regions have.

Specified by:
intersect in class XnRegion

simpleUnion

public XnRegion simpleUnion(XnRegion other)
Description copied from class: XnRegion
The result must contain all positions contained by either of the two original regions, and the result must be simple. However, the result may contain additional positions. See the comment on 'XuRegion::asSimpleRegion'. a->simpleUnion(b) satisfies the same specification as (a->unionWith(b))->asSimpleRegion(). However, the two results do not have to be the same region.

Specified by:
simpleUnion in class XnRegion

unionWith

public abstract XnRegion unionWith(XnRegion other)
Description copied from class: XnRegion
The result has as members exactly those positions which are members of either of the original two regions. No matter how simple the two original regions are, the result may be non-simple. The only reason this is called 'unionWith' instead of 'union' is that the latter is a C++ keyword.

Specified by:
unionWith in class XnRegion

coordinateSpace

public abstract CoordinateSpace coordinateSpace()
Description copied from class: XnRegion
Essential. The coordinate space in which this is a region

Specified by:
coordinateSpace in class XnRegion

projection

public XnRegion projection(int index)
The answer is the projection of this region into the specified dimension of the cross space


projections

public abstract PtrArray projections()
Essential. The answer is the projection of this region into each dimension of the cross space. Note that two regions which are different can have the same projections.


actualStepper

public abstract Stepper actualStepper(OrderSpec order)
Description copied from class: XnRegion
Only called if I've already said I'm enumerable in the originally stated order. Also, if the originally stated order was NULL, I get a guaranteed non-null order. Subclasses which override 'stepper' to a method which doesn't send 'actualStepper' may override 'actualStepper' to a stub method which always BLASTs.

Specified by:
actualStepper in class XnRegion

info

public static void info()
{Stepper CLIENT of: CrossRegion} boxes {BooleanVar CLIENT} isBox {XuRegion CLIENT} projection: index {Int32} {PtrArray CLIENT of: XuRegion} projections



Copyright © 2003 David G Jones. All Rights Reserved.
Original Udanax-Gold - Copyright © 1979-1999 Udanax.com. All rights reserved.