Top Description Fields Methods
org.apache.derby.iapi.store.access

public Interface BinaryOrderable

extends Orderable
Imports
org.apache.derby.iapi.types.Orderable, org.apache.derby.shared.common.error.StandardException, java.io.ObjectInput, .IOException

The Orderable interface represents a value that can be linearly ordered.

Currently only supports linear (<, =, <=) operations. Eventually we may want to do other types of orderings, in which case there would probably be a number of interfaces for each "class" of ordering.

The implementation must handle the comparison of null values. This may require some changes to the interface, since (at least in some contexts) comparing a value with null should return unknown instead of true or false.

Field Summary

Inherited from org.apache.derby.iapi.types.Orderable:
ORDER_OP_EQUALSORDER_OP_GREATEROREQUALSORDER_OP_GREATERTHANORDER_OP_LESSOREQUALSORDER_OP_LESSTHAN

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

<0 - this Orderable is less than other. 0 - this Orderable equals other. >0 - this Orderable is greater than other. The code should not explicitly look for -1, or 1.
binarycompare
(ObjectInput in, Orderable
The Orderable to compare this one to.
other
)

Compare this Orderable with a given Orderable for the purpose of index positioning.

public boolean

Returns:

true if the comparison is true.
binarycompare
(ObjectInput in, int
Orderable.ORDER_OP_EQUALS means do an = comparison. Orderable.ORDER_OP_LESSTHAN means compare this < other. Orderable.ORDER_OP_LESSOREQUALS means compare this <= other.
op
,
Orderable
The Orderable to compare this one to.
other
,
boolean
True means to treat nulls as ordered values, that is, treat SQL null as equal to null, and less than all other values. False means to treat nulls as unknown values, that is, the result of any comparison with a null is the UNKNOWN truth value.
orderedNulls
,
boolean
The return value to use if the result of the comparison is the UNKNOWN truth value. In other words, if orderedNulls is false, and a null is involved in the comparison, return unknownRV. This parameter is not used orderedNulls is true.
unknownRV
)

Compare this Orderable with a given Orderable for the purpose of qualification and sorting.

Method Detail

binarycompareback to summary
public int binarycompare(ObjectInput in, Orderable other) throws IOException

Compare this Orderable with a given Orderable for the purpose of index positioning. This method treats nulls as ordered values - that is, it treats SQL null as equal to null and less than all other values.

Parameters
other:Orderable

The Orderable to compare this one to.

Returns:int

<0 - this Orderable is less than other. 0 - this Orderable equals other. >0 - this Orderable is greater than other. The code should not explicitly look for -1, or 1.

Exceptions
IOException:
Thrown on error
binarycompareback to summary
public boolean binarycompare(ObjectInput in, int op, Orderable other, boolean orderedNulls, boolean unknownRV) throws IOException

Compare this Orderable with a given Orderable for the purpose of qualification and sorting. The caller gets to determine how nulls should be treated - they can either be ordered values or unknown values.

Parameters
op:int

Orderable.ORDER_OP_EQUALS means do an = comparison. Orderable.ORDER_OP_LESSTHAN means compare this < other. Orderable.ORDER_OP_LESSOREQUALS means compare this <= other.

other:Orderable

The Orderable to compare this one to.

orderedNulls:boolean

True means to treat nulls as ordered values, that is, treat SQL null as equal to null, and less than all other values. False means to treat nulls as unknown values, that is, the result of any comparison with a null is the UNKNOWN truth value.

unknownRV:boolean

The return value to use if the result of the comparison is the UNKNOWN truth value. In other words, if orderedNulls is false, and a null is involved in the comparison, return unknownRV. This parameter is not used orderedNulls is true.

Returns:boolean

true if the comparison is true.

Exceptions
IOException:
Thrown on error