jsky.catalog
Class ValueSearchCondition

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

public class ValueSearchCondition
extends AbstractSearchCondition

Represents a search condition for values in a given table column, or parameters to a query or request.

See Also:
Serialized Form

Constructor Summary
ValueSearchCondition(FieldDesc fieldDesc, java.lang.Comparable val)
          Create a new ValueSearchCondition for the given column or parameter description.
ValueSearchCondition(FieldDesc fieldDesc, double val)
          Create a new numerical ValueSearchCondition for the given column or parameter description.
ValueSearchCondition(FieldDesc fieldDesc, java.lang.String val)
          Create a new String ValueSearchCondition for the given column or parameter description.
 
Method Summary
 java.lang.Comparable getVal()
          Return the value (actually a Double or String)
 java.lang.String getValueAsString()
          Return the value as a String.
 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

ValueSearchCondition

public ValueSearchCondition(FieldDesc fieldDesc,
                            java.lang.Comparable val)
Create a new ValueSearchCondition for the given column or parameter description.


ValueSearchCondition

public ValueSearchCondition(FieldDesc fieldDesc,
                            double val)
Create a new numerical ValueSearchCondition for the given column or parameter description.


ValueSearchCondition

public ValueSearchCondition(FieldDesc fieldDesc,
                            java.lang.String val)
Create a new String ValueSearchCondition for the given column or parameter description.

Method Detail

getVal

public java.lang.Comparable getVal()
Return the value (actually a Double or String)


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 value as a String.


main

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