com.fdsapi.arrays
Class ConditionalBase

java.lang.Object
  |
  +--com.fdsapi.arrays.ConditionalBase
All Implemented Interfaces:
Conditional
Direct Known Subclasses:
ConditionalBaseComparator, ConditionalEquals

public abstract class ConditionalBase
extends java.lang.Object
implements Conditional

Abstract base class for other Conditional objects. This interface is used in where clauses to return true if the row in the array should be kept in the resulting array.



View Code


Field Summary
protected  int col
          Column number to be used in the comparsison
 
Constructor Summary
ConditionalBase(int col)
          A Constructor that takes the column to be compared in the decorator
ConditionalBase(int col, Conditional nextConditional)
          Contructor that takes the column to be compared as well as the next conditional in the decorator chain.
 
Method Summary
protected  java.lang.String getConditionalString(java.lang.Object comparisonValue)
          Display a String representation of this Conditional.
protected  Conditional getNextConditional()
          This method gets the next Conditional object in the decorator chain
 boolean isTrue(java.lang.Object[] row)
          This method implements the Template design pattern.
protected abstract  boolean isTrueThis(java.lang.Object[] row)
          This method must be implemented in child classes to specify if the row matches the comparison value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.fdsapi.arrays.Conditional
getType
 

Field Detail

col

protected int col
Column number to be used in the comparsison

Constructor Detail

ConditionalBase

public ConditionalBase(int col,
                       Conditional nextConditional)
Contructor that takes the column to be compared as well as the next conditional in the decorator chain.


ConditionalBase

public ConditionalBase(int col)
A Constructor that takes the column to be compared in the decorator

Method Detail

isTrue

public boolean isTrue(java.lang.Object[] row)
This method implements the Template design pattern. It takes the row as input and calls this classes logic as well as the next Conditional in the decorator chains isTrue(...) method. Any class that inherits from this one must implement the isTrueThis(...) method to determine if the passed in row should be kept.

Specified by:
isTrue in interface Conditional

isTrueThis

protected abstract boolean isTrueThis(java.lang.Object[] row)
This method must be implemented in child classes to specify if the row matches the comparison value


getNextConditional

protected Conditional getNextConditional()
This method gets the next Conditional object in the decorator chain


getConditionalString

protected java.lang.String getConditionalString(java.lang.Object comparisonValue)
Display a String representation of this Conditional.