jsky.catalog
Class ArraySearchCondition

java.lang.Object
  extended by jsky.catalog.AbstractSearchCondition
      extended by jsky.catalog.ArraySearchCondition
All Implemented Interfaces:
java.io.Serializable, SearchCondition

public class ArraySearchCondition
extends AbstractSearchCondition

Represents a search condition with an array of possible values. The condition evaluates to true, if any one of the values in the array match.

See Also:
Serialized Form

Constructor Summary
ArraySearchCondition(FieldDesc fieldDesc, java.lang.Object[] values)
          Create a new ArraySearchCondition with the given values.
 
Method Summary
 java.lang.String getValueAsString()
          Return the values as a String in the format "val1,val2,val3".
 java.lang.Object[] getValues()
          Return the array of values
 boolean isTrueFor(java.lang.Comparable val)
          Return true if the condition is true for the given value.
 boolean isTrueFor(double val)
          Return true if the condition is true for the given numeric value.
static void main(java.lang.String[] args)
          Test cases
 
Methods inherited from class jsky.catalog.AbstractSearchCondition
getFieldDesc, getId, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArraySearchCondition

public ArraySearchCondition(FieldDesc fieldDesc,
                            java.lang.Object[] values)
Create a new ArraySearchCondition with the given values.

Method Detail

getValues

public java.lang.Object[] getValues()
Return the array of values


isTrueFor

public boolean isTrueFor(java.lang.Comparable val)
Return true if the condition is true for the given value.

Parameters:
val - The value to be checked against the condition.
Returns:
true if the value satisfies the condition.

isTrueFor

public boolean isTrueFor(double val)
Return true if the condition is true for the given numeric value. If the condition was specified as a String, the return value is false.

Parameters:
val - The value to be checked against the condition.
Returns:
true if the value satisfies the condition.

getValueAsString

public java.lang.String getValueAsString()
Return the values as a String in the format "val1,val2,val3".


main

public static void main(java.lang.String[] args)
Test cases