org.palo.api.subsets.filter.settings
Class DataCriteria

java.lang.Object
  extended by org.palo.api.subsets.filter.settings.DataCriteria

public class DataCriteria
extends java.lang.Object

DataCriteria

A data criteria consists of one or two operators and their operands. Data criteria are used by a data filter to bound the subset elements by their value. With a data criteria expressions like take all elements > 400 are possible.

Version:
$Id: DataCriteria.html,v 1.5 2009/07/09 11:01:46 ArndHouben Exp $

Field Summary
static java.lang.String[] ALL_OPERATORS
           
static java.lang.String EQUAL
           
static java.lang.String GREATER
           
static java.lang.String GREATER_EQUAL
           
static java.lang.String LESSER
           
static java.lang.String LESSER_EQUAL
           
static java.lang.String NOT_EQUAL
           
 
Constructor Summary
DataCriteria(java.lang.String operator, java.lang.String operand)
          Creates a new DataCriteria instance with the given operator and operand
 
Method Summary
 void bind(Subset2 subset)
          Binds this instance to the given Subset2 NOTE: PLEASE DON'T USE!
 StringParameter getFirstOperand()
           
 java.lang.String getFirstOperator()
          Returns the first operator
 int getFirstOperatorIndex()
          Returns the index of the first operator inside the predefined operator constants array
 StringParameter getSecondOperand()
           
 java.lang.String getSecondOperator()
          Returns the second operator
 int getSecondOperatorIndex()
          Returns the index of the second operator inside the predefined operator constants array
 boolean hasSecondOperator()
          Checks if this criteria has an additional operator and operand
 void setFirstOperand(java.lang.String operand1)
          Sets the first operand
 void setFirstOperand(StringParameter operand1)
           
 void setFirstOperator(int index)
          Sets the first operator by specifying its index in the predefined operator constants array
 void setFirstOperator(java.lang.String operator1)
          Sets the operator to use as first operator
 void setSecondOperand(java.lang.String operand2)
          Sets the second operand
 void setSecondOperand(StringParameter operand2)
           
 void setSecondOperator(int index)
          Sets the second operator by specifying its index in the predefined operator constants array
 void setSecondOperator(java.lang.String operator2)
          Sets the operator to use as second operator
 void unbind()
          Releases this instance from a previously binded Subset2 NOTE: PLEASE DON'T USE!
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LESSER

public static final java.lang.String LESSER
See Also:
Constant Field Values

LESSER_EQUAL

public static final java.lang.String LESSER_EQUAL
See Also:
Constant Field Values

GREATER

public static final java.lang.String GREATER
See Also:
Constant Field Values

GREATER_EQUAL

public static final java.lang.String GREATER_EQUAL
See Also:
Constant Field Values

NOT_EQUAL

public static final java.lang.String NOT_EQUAL
See Also:
Constant Field Values

EQUAL

public static final java.lang.String EQUAL
See Also:
Constant Field Values

ALL_OPERATORS

public static final java.lang.String[] ALL_OPERATORS
Constructor Detail

DataCriteria

public DataCriteria(java.lang.String operator,
                    java.lang.String operand)
Creates a new DataCriteria instance with the given operator and operand

Parameters:
operator - one of the defined operator constants
operand - an operand value
Method Detail

hasSecondOperator

public final boolean hasSecondOperator()
Checks if this criteria has an additional operator and operand

Returns:
true if this criteria has a second expression, false otherwise

getFirstOperator

public final java.lang.String getFirstOperator()
Returns the first operator

Returns:
the first operator

getFirstOperatorIndex

public final int getFirstOperatorIndex()
Returns the index of the first operator inside the predefined operator constants array

Returns:
first operator index

setFirstOperator

public final void setFirstOperator(java.lang.String operator1)
Sets the operator to use as first operator

Parameters:
operator1 - the new first operator

setFirstOperator

public final void setFirstOperator(int index)
Sets the first operator by specifying its index in the predefined operator constants array

Parameters:
index - the new first operator

getSecondOperator

public final java.lang.String getSecondOperator()
Returns the second operator

Returns:
the second operator

getSecondOperatorIndex

public final int getSecondOperatorIndex()
Returns the index of the second operator inside the predefined operator constants array

Returns:
second operator index

setSecondOperator

public final void setSecondOperator(java.lang.String operator2)
Sets the operator to use as second operator

Parameters:
operator2 - the new second operator

setSecondOperator

public final void setSecondOperator(int index)
Sets the second operator by specifying its index in the predefined operator constants array

Parameters:
index - the new second operator

getFirstOperand

public final StringParameter getFirstOperand()

setFirstOperand

public final void setFirstOperand(java.lang.String operand1)
Sets the first operand

Parameters:
operand1 - the new first operand

setFirstOperand

public final void setFirstOperand(StringParameter operand1)

getSecondOperand

public final StringParameter getSecondOperand()

setSecondOperand

public final void setSecondOperand(java.lang.String operand2)
Sets the second operand

Parameters:
operand2 - the new second operand

setSecondOperand

public final void setSecondOperand(StringParameter operand2)

bind

public final void bind(Subset2 subset)

Binds this instance to the given Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD

Parameters:
subset -

unbind

public final void unbind()

Releases this instance from a previously binded Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD