org.abora.white.spaces.basic
Class OrderSpec

java.lang.Object
  |
  +--org.abora.white.xpp.basic.Heaper
        |
        +--org.abora.white.spaces.basic.OrderSpec
Direct Known Subclasses:
CrossOrderSpec, IntegerUpOrder, RealUpOrder, ReverseOrder, SequenceUpOrder

public abstract class OrderSpec
extends Heaper

An OrderSpec for a given coordinate space represents a partial ordering of all the Positions of that coordinate space. The fundamental ordering relationship is "follows". The response of Positions to isGE defines the natural, "ascending" partial order among the positions. Every coordinate space will have at least this ascending and the corresponding descending OrderSpecs. OrderSpecs are useful to specify in what order a stepper produced for stepping over positions should do so.

[documentation note: we need to hide the documentation about partial orders, but still warn that the orders may become partial].


Constructor Summary
protected OrderSpec()
           
protected OrderSpec(Rcvr receiver)
           
 
Method Summary
 int actualHashForEqual()
          Defined by subclasses to produce the value returned by hashForEqual.
 Arrangement arrange(XnRegion region)
          Return an Arrangement of the positions in region according to the ordering of the receiver.
 OrderEnum compare(Position x, Position y)
          Say what the relative ordering relationship is between x and y
abstract  CoordinateSpace coordinateSpace()
          Essential.
abstract  boolean follows(Position x, Position y)
          Essential.
 boolean followsInt(IntegerValue x, IntegerValue y)
          See discussion in XuInteger class comment about boxed vs unboxed integers
abstract  boolean isEqual(Heaper other)
          Return true if the two objects are equal.
 boolean isFullOrder()
           
abstract  boolean isFullOrder(XnRegion keys)
          Essential.
abstract  boolean preceeds(XnRegion before, XnRegion after)
          Return true if some position in before is less than or equal to all positions in after.
 OrderSpec reversed()
          Returns an OrderSpec representing the mirror image of my ordering.
 void sendSelfTo(Xmtr xmtr)
           
 
Methods inherited from class org.abora.white.xpp.basic.Heaper
destroy, destruct, equals, hashForEqual, printContentsOn, printOn, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderSpec

protected OrderSpec()

OrderSpec

protected OrderSpec(Rcvr receiver)
Method Detail

actualHashForEqual

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

Overrides:
actualHashForEqual in class Heaper

compare

public OrderEnum compare(Position x,
                         Position y)
Say what the relative ordering relationship is between x and y


follows

public abstract boolean follows(Position x,
                                Position y)
Essential. Compare the two and return true if x is known to follow y in the ordering. This message is the 'greater than or equal to' equivalent for this ordering. It must have those properties a mathematician would demand of a '>=' on a partial order: os->follows(a, a) (reflexivity) os->follows(a, b) && os->follows(b, c) implies os->follows(a, c) (transitivity) os->follows(a, b) && os->follows(b, a) implies a->isEqual(b) (what's the name for this?)


followsInt

public boolean followsInt(IntegerValue x,
                          IntegerValue y)
See discussion in XuInteger class comment about boxed vs unboxed integers


isEqual

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

Specified by:
isEqual in class Heaper

isFullOrder

public abstract boolean isFullOrder(XnRegion keys)
Essential. If this returns TRUE, then I define a full order over all positions in 'keys' (or all positions in the space if 'keys' is NULL). However, if I return FALSE, that doesn't guarantee that I don't define a full ordering. I may happen to define a full ordering without knowing it. A full ordering is one in which for each a, b in keys; either this->follows(a, b) or this->follows(b, a).


isFullOrder

public boolean isFullOrder()

preceeds

public abstract boolean preceeds(XnRegion before,
                                 XnRegion after)
Return true if some position in before is less than or equal to all positions in after.


arrange

public Arrangement arrange(XnRegion region)
Return an Arrangement of the positions in region according to the ordering of the receiver.


coordinateSpace

public abstract CoordinateSpace coordinateSpace()
Essential. Like Positions, Dsps, and XuRegions, an OrderSpec is specific to one coordinate space. It is an error to use the generic protocol on objects from different coordinate spaces.


reversed

public OrderSpec reversed()
Returns an OrderSpec representing the mirror image of my ordering. o->follows(a, b) iff o->reverse()->follows(b, a)


sendSelfTo

public void sendSelfTo(Xmtr xmtr)
Overrides:
sendSelfTo in class Heaper


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