com.fdsapi.arrays
Class ConditionalLessThan

java.lang.Object
  |
  +--com.fdsapi.arrays.ConditionalBase
        |
        +--com.fdsapi.arrays.ConditionalBaseComparator
              |
              +--com.fdsapi.arrays.ConditionalLessThan
All Implemented Interfaces:
java.util.Comparator, Conditional

public class ConditionalLessThan
extends ConditionalBaseComparator

Conditional used to test to see if a column value is less than value to compare it against. The column value must be of type Comparable.

View Code


Field Summary
 
Fields inherited from class com.fdsapi.arrays.ConditionalBaseComparator
comparisonValue
 
Fields inherited from class com.fdsapi.arrays.ConditionalBase
col
 
Constructor Summary
ConditionalLessThan(int col, java.lang.Comparable comparisonValue)
          Pass in the column to compare nad the value that it will be compared against.
ConditionalLessThan(int col, java.lang.Comparable comparisonValue, Conditional nextConditional)
          Pass in the column to compare the value that it will compare against and the next Condtional in the decorator chain.
 
Method Summary
 int compare(java.lang.Object colValue, java.lang.Object compValue)
          Method used by the comparator interface.
 java.lang.String getType()
          Used to help create a String represenation of this Conditional.
protected  boolean isTrueThis(java.lang.Object[] row)
          Returns true if the column value is less than the comparison value.
 
Methods inherited from class com.fdsapi.arrays.ConditionalBaseComparator
toString
 
Methods inherited from class com.fdsapi.arrays.ConditionalBase
getConditionalString, getNextConditional, isTrue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ConditionalLessThan

public ConditionalLessThan(int col,
                           java.lang.Comparable comparisonValue)
Pass in the column to compare nad the value that it will be compared against.


ConditionalLessThan

public ConditionalLessThan(int col,
                           java.lang.Comparable comparisonValue,
                           Conditional nextConditional)
Pass in the column to compare the value that it will compare against and the next Condtional in the decorator chain.

Method Detail

isTrueThis

protected boolean isTrueThis(java.lang.Object[] row)
Returns true if the column value is less than the comparison value. If both column value and comparison value are null then the method returns false else if either is null return false.

Specified by:
isTrueThis in class ConditionalBase

compare

public int compare(java.lang.Object colValue,
                   java.lang.Object compValue)
Method used by the comparator interface.

o1 < o2 - returns a negative integer
o1==o2 - returns zero
o1>o2 - returns a postitive integer

Iterate through all columns that should be compared (in the proper order) and call the Comparator for each of the column elements. Note the column value is always the first argument and the comparison value is always the second


getType

public java.lang.String getType()
Used to help create a String represenation of this Conditional. Returns "<"