org.abora.white.spaces.cross
Class BoxStepper

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.collection.steppers.Stepper
              |
              +--org.abora.white.spaces.cross.BoxStepper

public class BoxStepper
extends Stepper

Steps over all boxes. was NOT.A.TYPE but this prevented compilation


Field Summary
protected  int myIndex
           
protected  GenericCrossRegion myRegion
           
protected  XnRegion myValue
           
protected static InstanceCache SomeSteppers
           
 
Fields inherited from class org.abora.white.collection.steppers.Stepper
TheEmptyStepper
 
Constructor Summary
BoxStepper(GenericCrossRegion region)
           
BoxStepper(GenericCrossRegion region, int index, XnRegion value)
           
 
Method Summary
 GenericCrossRegion boxComplement()
          The complement of this box
 BoxAccumulator boxComplementAccumulator()
          The complement of this box
 int boxHash()
           
 boolean boxHasMember(ActualTuple tuple)
          Whether my current box contains a position
 int boxIndex()
           
 boolean boxIntersects(BoxStepper other)
          Whether my current box intersects others current box
 boolean boxIsEqual(BoxStepper other)
          Whether my current box isEqual others current box
 boolean boxIsSubsetOf(BoxStepper other)
          Whether my current box isSubsetOf others current box
 Stepper copy()
          Return a new stepper which steps independently of me, but whose current value is the same as mine, and which must produce a future history of values which satisfies the same obligation that my contract obligates me to produce now.
 void destroy()
           
 Heaper fetch()
          If I am exhausted (i.e., if (!! this->hasValue())), then return NULL.
 boolean hasValue()
          Iff I have a current value (i.e.
 boolean intersectBoxInto(PtrArray result, int boxIndex)
          Intersect each projection in the box into the array.
 boolean isBoxOf(GenericCrossRegion other)
          Whether my box is also a box in the other region
static BoxStepper make(GenericCrossRegion region)
           
 XnRegion projection(int dimension)
          The projection of my current box into one dimension
 BoxProjectionStepper projectionStepper()
          A stepper over all the projections in the current box
 GenericCrossRegion region()
           
 void step()
          Essential.
 void unionBoxInto(PtrArray result, int boxIndex)
          Union each projection in the box into the array
 
Methods inherited from class org.abora.white.collection.steppers.Stepper
actualHashForEqual, atEnd, emptyStepper, get, info, isEqual, itemStepper, stepMany, stepMany, theOne
 
Methods inherited from class org.abora.white.xpp.basic.Heaper
destruct, equals, hashForEqual, printContentsOn, printOn, sendSelfTo, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myRegion

protected GenericCrossRegion myRegion

myIndex

protected int myIndex

myValue

protected XnRegion myValue

SomeSteppers

protected static InstanceCache SomeSteppers
Constructor Detail

BoxStepper

public BoxStepper(GenericCrossRegion region)

BoxStepper

public BoxStepper(GenericCrossRegion region,
                  int index,
                  XnRegion value)
Method Detail

fetch

public Heaper fetch()
Description copied from class: Stepper
If I am exhausted (i.e., if (!! this->hasValue())), then return NULL. Else return current element. I return wimpily since most items returned are held by collections. If I create a new object, I should cache it.

Specified by:
fetch in class Stepper

hasValue

public boolean hasValue()
Description copied from class: Stepper
Iff I have a current value (i.e. this message returns true), then I am not exhasted. 'fetch' and 'get' will both return this value, and I can be 'step'ped to my next state. As I am stepped, eventually I may become exhausted (the reverse of all the above), which is a permanent condition. Note that not all steppers have to be exhaustable. A Stepper which enumerates all primes is perfectly reasonable. Assuming otherwise will create infinite loops. See class comment.

Specified by:
hasValue in class Stepper

step

public void step()
Description copied from class: Stepper
Essential. If I am currently exhausted (see Stepper::hasValue()), then it is an error to step me. The result of doing so isn't currently specified (we probably should specify it to BLAST, but I know that the implementation doesn't currently live up to that spec). If I am not exhausted, then this advances me to my next state. If my current value (see Stepper::get()) was my final value, then I am now exhausted, otherwise my new current value is the next value.

Specified by:
step in class Stepper

copy

public Stepper copy()
Description copied from class: Stepper
Return a new stepper which steps independently of me, but whose current value is the same as mine, and which must produce a future history of values which satisfies the same obligation that my contract obligates me to produce now. Typically, this will mean that he must produce the same future history that I'm going to produce. However, let's say that I am enumerating the elements of a partial order in some full order which is consistent with the partial order. If a copy of me is made after I'm part way through, then me and my copy may produce any future history compatable both with the partial order and the elements I've already produced by the time of the copy. Of course, a subclass or a Stepper creating message (like IntegerRegion::stepper()) may specify the more stringent requirement (that a copy must produce the same sequence). To prevent aliasing, Steppers should typically be passed by copy. See class comment.

Specified by:
copy in class Stepper

destroy

public void destroy()
Overrides:
destroy in class Heaper

boxComplement

public GenericCrossRegion boxComplement()
The complement of this box


boxComplementAccumulator

public BoxAccumulator boxComplementAccumulator()
The complement of this box


boxHash

public int boxHash()

boxHasMember

public boolean boxHasMember(ActualTuple tuple)
Whether my current box contains a position


boxIndex

public int boxIndex()

boxIntersects

public boolean boxIntersects(BoxStepper other)
Whether my current box intersects others current box


boxIsEqual

public boolean boxIsEqual(BoxStepper other)
Whether my current box isEqual others current box


boxIsSubsetOf

public boolean boxIsSubsetOf(BoxStepper other)
Whether my current box isSubsetOf others current box


intersectBoxInto

public boolean intersectBoxInto(PtrArray result,
                                int boxIndex)
Intersect each projection in the box into the array. Return false if the result is empty, stopping at the first dimension for which the intersection is empty.


isBoxOf

public boolean isBoxOf(GenericCrossRegion other)
Whether my box is also a box in the other region


projection

public XnRegion projection(int dimension)
The projection of my current box into one dimension


projectionStepper

public BoxProjectionStepper projectionStepper()
A stepper over all the projections in the current box


region

public GenericCrossRegion region()

unionBoxInto

public void unionBoxInto(PtrArray result,
                         int boxIndex)
Union each projection in the box into the array


make

public static BoxStepper make(GenericCrossRegion region)


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