net.sourceforge.jpalm.mobiledb
Class FilterCriterion

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

public class FilterCriterion
extends DataBlock

The filter criterion in a MobileDB database. This contains information regarding how the database was last filtered and does not enforce filtering.


Field Summary
static int DATA_LENGTH
          The length of this DataBlock in bytes.
42
static net.sourceforge.juint.Int8 FIELD_ALL
          This filter applies to all fields.
static int FIELD_LENGTH
          The maximum length of the filter text.
40
static net.sourceforge.juint.Int8 FIELD_NONE
          This filter doesn't apply to any fields (Disables the filter).
static net.sourceforge.juint.Int8 FIELD_OFFSET
          This filter applies to a specific field--it should be added to this offset.
static net.sourceforge.juint.UInt8 FLAG_CONTAINS
          Filter "contains".
static net.sourceforge.juint.UInt8 FLAG_CONTAINS_NOT
          Filter "contains not".
static net.sourceforge.juint.UInt8 FLAG_IS
          Filter "is".
static net.sourceforge.juint.UInt8 FLAG_IS_NOT
          Filter "is not".
static net.sourceforge.juint.UInt8 FLAG_MATCH_ALL
          Filter records by matching all filter criterions.
static net.sourceforge.juint.UInt8 FLAG_MATCH_ANY
          Filter records by matching any filter criterions.
 
Constructor Summary
FilterCriterion()
          Creates a new filter criterion.
FilterCriterion(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 filter on.
 java.lang.String getFilter()
          Gets the filter.
 net.sourceforge.juint.UInt8 getFlags()
          Gets the flags.
 byte[] serialize()
          Create a byte array of the class properties.
 void setFieldNumber(net.sourceforge.juint.Int8 fieldNumber)
          Sets the field number to filter on.
 void setFilter(java.lang.String filter)
          Sets the filter.
 void setFlags(net.sourceforge.juint.UInt8 flags)
          Sets the flags.
 
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_LENGTH

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

See Also:
Constant Field Values

FIELD_LENGTH

public static final int FIELD_LENGTH
The maximum length of the filter text.
40

See Also:
Constant Field Values

FIELD_NONE

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


FIELD_ALL

public static final net.sourceforge.juint.Int8 FIELD_ALL
This filter applies to all fields.


FIELD_OFFSET

public static final net.sourceforge.juint.Int8 FIELD_OFFSET
This filter applies to a specific field--it should be added to this offset. If the field is 3, then it should be set as
 setFieldNumber(new Int8(FilterCriterion.FIELD_OFFSET.int8Value() + 3));
 


FLAG_MATCH_ALL

public static final net.sourceforge.juint.UInt8 FLAG_MATCH_ALL
Filter records by matching all filter criterions. xor this with flags on the first criterion only.


FLAG_MATCH_ANY

public static final net.sourceforge.juint.UInt8 FLAG_MATCH_ANY
Filter records by matching any filter criterions. xor this with flags on the first criterion only.


FLAG_IS

public static final net.sourceforge.juint.UInt8 FLAG_IS
Filter "is".


FLAG_CONTAINS

public static final net.sourceforge.juint.UInt8 FLAG_CONTAINS
Filter "contains".


FLAG_IS_NOT

public static final net.sourceforge.juint.UInt8 FLAG_IS_NOT
Filter "is not".


FLAG_CONTAINS_NOT

public static final net.sourceforge.juint.UInt8 FLAG_CONTAINS_NOT
Filter "contains not".

Constructor Detail

FilterCriterion

public FilterCriterion()
Creates a new filter criterion. Defaults to an empty filter.


FilterCriterion

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

Parameters:
data - the byte array
Method Detail

getFilter

public java.lang.String getFilter()
Gets the filter.

Returns:
the filter

setFilter

public void setFilter(java.lang.String filter)
Sets the filter.

Parameters:
filter - the filter

getFieldNumber

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

If not one of FIELD_ALL or FIELD_NONE the field number should be subtracted from FIELD_OFFSET.

Returns:
the field number

setFieldNumber

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

If not one of FIELD_ALL or FIELD_NONE the field number should be added to FIELD_OFFSET.

Parameters:
fieldNumber - the field number

getFlags

public net.sourceforge.juint.UInt8 getFlags()
Gets the flags.

Returns:
the flags
See Also:
FLAG_CONTAINS, FLAG_CONTAINS_NOT, FLAG_IS, FLAG_IS_NOT, FLAG_MATCH_ALL, FLAG_MATCH_ANY

setFlags

public void setFlags(net.sourceforge.juint.UInt8 flags)
Sets the flags.

Parameters:
flags - the flags
See Also:
FLAG_CONTAINS, FLAG_CONTAINS_NOT, FLAG_IS, FLAG_IS_NOT, FLAG_MATCH_ALL, FLAG_MATCH_ANY

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