net.sourceforge.jpalm.mobiledb
Class SortCriterion

java.lang.Object
  extended by net.sourceforge.jpalm.DataBlock
      extended by net.sourceforge.jpalm.mobiledb.SortCriterion

public class SortCriterion
extends DataBlock

The sort criterion in a MobileDB database. This contains information regarding how the database was last sorted and does not enforce sorting.


Field Summary
static int DATA_LENGH
          The length of this DataBlock in bytes.
static net.sourceforge.juint.Int8 FIELD_NONE
          This sort doesn't apply to any fields (Disables the sort).
 
Constructor Summary
SortCriterion()
          Creates a new sort criterion.
SortCriterion(byte[] data)
          Creates a new criterion from the byte array.
 
Method Summary
 void deserialize(byte[] data)
          Populate class properties from a byte array.
 boolean equals(java.lang.Object object)
           
 net.sourceforge.juint.Int8 getFieldNumber()
          Gets the field number to sort on.
 byte[] getReserved()
          Gets the reserved bytes.
 boolean isDescending()
          Gets the descending flag.
 byte[] serialize()
          Create a byte array of the class properties.
 void setDescending(boolean descending)
          Sets the descending flag.
 void setFieldNumber(net.sourceforge.juint.Int8 fieldNumber)
          Sets the field number to sort on.
 void setReserved(byte[] reserved)
          Sets the reserved bytes.
 
Methods inherited from class net.sourceforge.jpalm.DataBlock
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_LENGH

public static final int DATA_LENGH
The length of this DataBlock in bytes.

See Also:
Constant Field Values

FIELD_NONE

public static final net.sourceforge.juint.Int8 FIELD_NONE
This sort doesn't apply to any fields (Disables the sort).

Constructor Detail

SortCriterion

public SortCriterion()
Creates a new sort criterion. Defaults to an unused criterion.


SortCriterion

public SortCriterion(byte[] data)
Creates a new criterion from the byte array.

Parameters:
data - the byte array
Method Detail

isDescending

public boolean isDescending()
Gets the descending flag.

Returns:
true if the sort is descending; false if the sort is ascending

setDescending

public void setDescending(boolean descending)
Sets the descending flag. Default is false.

Parameters:
descending - true if the sort is descending; false if the sort is ascending

getFieldNumber

public net.sourceforge.juint.Int8 getFieldNumber()
Gets the field number to sort on.

Returns:
the field number or FIELD_NONE

setFieldNumber

public void setFieldNumber(net.sourceforge.juint.Int8 fieldNumber)
Sets the field number to sort on.

Parameters:
fieldNumber - the field number or FIELD_NONE

getReserved

public byte[] getReserved()
Gets the reserved bytes. These bytes are reserved for future versions of MobileDB.

Returns:
the reserved bytes

setReserved

public void setReserved(byte[] reserved)
Sets the reserved bytes. These bytes are reserved for future versions of MobileDB.

Parameters:
reserved - the reserved bytes

deserialize

public void deserialize(byte[] data)
Description copied from class: DataBlock
Populate class properties from a byte array.

Specified by:
deserialize in class DataBlock
Parameters:
data - the byte array

serialize

public byte[] serialize()
Description copied from class: DataBlock
Create a byte array of the class properties.

Specified by:
serialize in class DataBlock
Returns:
the byte array

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class DataBlock