org.abora.white.edge
Class EdgeManager

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.edge.EdgeManager
Direct Known Subclasses:
RealManager, SequenceManager

public abstract class EdgeManager
extends Heaper

Manages the common code for regions which are represented as a sequence of EdgeTransitions. Each coordinate space should define a subclass which implements the appropriate methods, and then use it to do the various region operations. Clients of the region do not need to see any of these classes.


Constructor Summary
protected EdgeManager()
           
protected EdgeManager(Rcvr rcvr)
           
 
Method Summary
 int actualHashForEqual()
          Defined by subclasses to produce the value returned by hashForEqual.
 XnRegion asSimpleRegion(XnRegion region)
           
 XnRegion complement(XnRegion region)
           
 IntegerValue count(XnRegion region)
          Because Edge Regions should only be used on infinitely divisible spaces (like rationals), if it's finite then it is bounded on both sides, and all the internal intervals are singletons
 ScruSet distinctions(XnRegion region)
           
 EdgeAccumulator edgeAccumulator(boolean startsInside)
          Create an accumulator which takes edges and creates a region
abstract  Position edgePosition(TransitionEdge edge)
          The position associated with the given edge.
 EdgeStepper edgeStepper(XnRegion region)
          Create a stepper for iterating through the edges of the region
 Position greatestLowerBound(XnRegion region)
          The largest position such that no other positions in the region are any less than it.
 boolean hasMember(XnRegion region, Position pos)
           
 XnRegion intersect(XnRegion meRegion, XnRegion otherRegion)
           
 boolean isBoundedLeft(XnRegion region)
          Same meaning as IntegerRegion::isBoundedLeft
 boolean isBoundedRight(XnRegion region)
          Same meaning as IntegerRegion::isBoundedRight
 boolean isEmpty(XnRegion region)
           
 boolean isEqual(Heaper other)
          Return true if the two objects are equal.
 boolean isFinite(XnRegion region)
          Here is one place where the *infinite* of the infinite divisibility assumed by OrderedRegion about the full ordering comes in (see class comment).
 boolean isFull(XnRegion region)
           
 boolean isSimple(XnRegion region)
           
 boolean isSubsetOf(XnRegion me, XnRegion other)
           
 Position leastUpperBound(XnRegion region)
          The smallest position such that no other positions in the region are any greater than it.
 TransitionEdge lowerEdge(XnRegion region)
           
abstract  XnRegion makeNew(boolean startsInside, PtrArray transitions)
          Make a new region of the right type
abstract  XnRegion makeNew(boolean startsInside, PtrArray transitions, int count)
          Make a new region of the right type
abstract  PtrArray posTransitions(Position pos)
           
 void printRegionOn(XnRegion region, java.io.PrintWriter oo)
           
 Stepper simpleRegions(XnRegion region, OrderSpec order)
           
 XnRegion simpleUnion(XnRegion me, XnRegion other)
           
 EdgeStepper singleEdgeStepper(Position pos)
          Create a stepper for iterating through the edges of the region
abstract  boolean startsInside(XnRegion region)
           
abstract  PtrArray transitions(XnRegion region)
           
abstract  int transitionsCount(XnRegion region)
           
 XnRegion unionWith(XnRegion meRegion, XnRegion otherRegion)
           
 TransitionEdge upperEdge(XnRegion region)
           
 XnRegion with(XnRegion meRegion, Position newPos)
           
 
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

EdgeManager

protected EdgeManager()

EdgeManager

protected EdgeManager(Rcvr rcvr)
Method Detail

edgeAccumulator

public EdgeAccumulator edgeAccumulator(boolean startsInside)
Create an accumulator which takes edges and creates a region


edgeStepper

public EdgeStepper edgeStepper(XnRegion region)
Create a stepper for iterating through the edges of the region


lowerEdge

public TransitionEdge lowerEdge(XnRegion region)

singleEdgeStepper

public EdgeStepper singleEdgeStepper(Position pos)
Create a stepper for iterating through the edges of the region


upperEdge

public TransitionEdge upperEdge(XnRegion region)

hasMember

public boolean hasMember(XnRegion region,
                         Position pos)

isBoundedLeft

public boolean isBoundedLeft(XnRegion region)
Same meaning as IntegerRegion::isBoundedLeft


isBoundedRight

public boolean isBoundedRight(XnRegion region)
Same meaning as IntegerRegion::isBoundedRight


isEmpty

public boolean isEmpty(XnRegion region)

isFinite

public boolean isFinite(XnRegion region)
Here is one place where the *infinite* of the infinite divisibility assumed by OrderedRegion about the full ordering comes in (see class comment). An interval whose left edge is not the same as the right edge is assumed to contain an infinite number of positions


isFull

public boolean isFull(XnRegion region)

isSimple

public boolean isSimple(XnRegion region)

isSubsetOf

public boolean isSubsetOf(XnRegion me,
                          XnRegion other)

count

public IntegerValue count(XnRegion region)
Because Edge Regions should only be used on infinitely divisible spaces (like rationals), if it's finite then it is bounded on both sides, and all the internal intervals are singletons


asSimpleRegion

public XnRegion asSimpleRegion(XnRegion region)

greatestLowerBound

public Position greatestLowerBound(XnRegion region)
The largest position such that no other positions in the region are any less than it. In other words, this is the lower bounding element. We choose to avoid the terms 'lowerBound' and 'upperBound' as their meanings in IntegerRegion are significantly different. Here, both 'all numbers >= 3' and 'all numbers > 3' have a 'greatestLowerBound' of 3 even though the latter doesn't include 3. To tell whether a bound is included, good old 'hasMember' should do a fine job.


leastUpperBound

public Position leastUpperBound(XnRegion region)
The smallest position such that no other positions in the region are any greater than it. In other words, this is the upper bounding element. We choose to avoid the terms 'lowerBound' and 'upperBound' as their meanings in IntegerRegion are significantly different. Here, both 'all numbers <= 3' and 'all numbers < 3' have a 'leastUpperBound' of 3 even though the latter doesn't include 3. To tell whether a bound is included, good old 'hasMember' should do a fine job.


simpleUnion

public XnRegion simpleUnion(XnRegion me,
                            XnRegion other)

printRegionOn

public void printRegionOn(XnRegion region,
                          java.io.PrintWriter oo)

complement

public XnRegion complement(XnRegion region)

distinctions

public ScruSet distinctions(XnRegion region)

intersect

public XnRegion intersect(XnRegion meRegion,
                          XnRegion otherRegion)

simpleRegions

public Stepper simpleRegions(XnRegion region,
                             OrderSpec order)

unionWith

public XnRegion unionWith(XnRegion meRegion,
                          XnRegion otherRegion)

with

public XnRegion with(XnRegion meRegion,
                     Position newPos)

edgePosition

public abstract Position edgePosition(TransitionEdge edge)
The position associated with the given edge. Blast if there is none


makeNew

public abstract XnRegion makeNew(boolean startsInside,
                                 PtrArray transitions)
Make a new region of the right type


makeNew

public abstract XnRegion makeNew(boolean startsInside,
                                 PtrArray transitions,
                                 int count)
Make a new region of the right type


posTransitions

public abstract PtrArray posTransitions(Position pos)

startsInside

public abstract boolean startsInside(XnRegion region)

transitions

public abstract PtrArray transitions(XnRegion region)

transitionsCount

public abstract int transitionsCount(XnRegion region)

actualHashForEqual

public int actualHashForEqual()
Description copied from class: Heaper
Defined by subclasses to produce the value returned by hashForEqual.

Overrides:
actualHashForEqual in class Heaper

isEqual

public boolean isEqual(Heaper other)
Description copied from class: Heaper
Return true if the two objects are equal.

Specified by:
isEqual in class Heaper


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