org.jaffa.components.finder
Class IntegerCriteriaField

java.lang.Object
  extended byorg.jaffa.components.finder.IntegerCriteriaField
All Implemented Interfaces:
CriteriaField

public class IntegerCriteriaField
extends Object
implements CriteriaField

This class will be used by the Finder components to hold an Integer criteria.


Field Summary
 
Fields inherited from interface org.jaffa.components.finder.CriteriaField
CONSECUTIVE_SEPARATORS, CONSECUTIVE_SEPARATORS_WITH_SPACE, RELATIONAL_BEGINS_WITH, RELATIONAL_BETWEEN, RELATIONAL_ENDS_WITH, RELATIONAL_EQUALS, RELATIONAL_GREATER_THAN, RELATIONAL_GREATER_THAN_EQUAL_TO, RELATIONAL_IN, RELATIONAL_IS_NOT_NULL, RELATIONAL_IS_NULL, RELATIONAL_LIKE, RELATIONAL_NOT_EQUALS, RELATIONAL_SMALLER_THAN, RELATIONAL_SMALLER_THAN_EQUAL_TO, SEPARATOR_CHAR_FOR_IN_BETWEEN_OPERATORS, SEPARATOR_FOR_IN_BETWEEN_OPERATORS
 
Constructor Summary
IntegerCriteriaField()
          Default constructor.
IntegerCriteriaField(String operator, Long value)
          Adds a Criteria.
IntegerCriteriaField(String operator, Long[] values)
          Adds a Criteria.
 
Method Summary
static IntegerCriteriaField getIntegerCriteriaField(String operator, String value, IntegerFieldMetaData meta)
          This will generate a CriteriaField object based on the input parameters.
 String getOperator()
          Getter for property operator.
 Long[] getValues()
          Getter for property values.
 Object[] returnValuesAsObjectArray()
          Getter for property values.
 void setOperator(String operator)
          Setter for the property operator.
 void setValues(Long[] values)
          Setter for the property values.
 String toString()
          Returns diagnostic information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerCriteriaField

public IntegerCriteriaField(String operator,
                            Long value)
                     throws IllegalArgumentException
Adds a Criteria.

Parameters:
operator - the operator of the criteria.
value - the value of the criteria.
Throws:
IllegalArgumentException - if the operator is null. The exception will also be thrown if the value is null and the operator is neither 'IsNull' nor 'IsNotNull'.

IntegerCriteriaField

public IntegerCriteriaField(String operator,
                            Long[] values)
                     throws IllegalArgumentException
Adds a Criteria.

Parameters:
operator - the operator of the criteria.
values - the value array of the criteria.
Throws:
IllegalArgumentException - if the operator is null. The exception will also be thrown if the value is null and the operator is neither 'IsNull' nor 'IsNotNull'.

IntegerCriteriaField

public IntegerCriteriaField()
Default constructor. NOTE: This was added to support tools, which create instances of this class by bean introspection. In all other cases, it is recommended to use the static methods to instantiate this class.

Method Detail

getOperator

public String getOperator()
Getter for property operator.

Specified by:
getOperator in interface CriteriaField
Returns:
Value of property operator.

returnValuesAsObjectArray

public Object[] returnValuesAsObjectArray()
Getter for property values. This basically invokes the getValues() method.

Specified by:
returnValuesAsObjectArray in interface CriteriaField
Returns:
An array of values for the Criteria.

getValues

public Long[] getValues()
Getter for property values.

Returns:
An array of values for the Criteria.

toString

public String toString()
Returns diagnostic information.

Returns:
diagnostic information.

getIntegerCriteriaField

public static IntegerCriteriaField getIntegerCriteriaField(String operator,
                                                           String value,
                                                           IntegerFieldMetaData meta)
                                                    throws FormatIntegerException
This will generate a CriteriaField object based on the input parameters.

Parameters:
operator - The operator of the criteria.
value - The value for the criteria. Multiple values should be separated by comma.
meta - The FieldMetaData object to obtain the layout for parsing.
Returns:
a CriteriaField object based on the input parameters.
Throws:
FormatIntegerException - if the value is incorrectly formatted.

setOperator

public void setOperator(String operator)
Setter for the property operator. NOTE: This was added to support tools, which create instances of this class by bean introspection. In all other cases, it is recommended to use the static methods to instantiate this class.

Parameters:
operator - The value of the property operator.

setValues

public void setValues(Long[] values)
Setter for the property values. NOTE: This was added to support tools, which create instances of this class by bean introspection. In all other cases, it is recommended to use the static methods to instantiate this class.

Parameters:
values - The value of the property values.


Copyright © 2002-2004 JAFFA Project.