com.fdsapi.arrays
Class ConditionalFactory

java.lang.Object
  |
  +--com.fdsapi.arrays.ConditionalFactory

public class ConditionalFactory
extends java.lang.Object

A Factory design pattern that creates the various Conditional classes that test for =,<,>, != and more.

View Code


Constructor Summary
ConditionalFactory()
           
 
Method Summary
static Conditional createInstance(int col, java.lang.String type, java.lang.Object comparisonValue)
          Some objects such as Boolean() do not implement the Comparator interface and so equals comparisons could not be called, so when an Object that doesn't implement Comparator is passed with a type of =, or == this method was created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionalFactory

public ConditionalFactory()
Method Detail

createInstance

public static Conditional createInstance(int col,
                                         java.lang.String type,
                                         java.lang.Object comparisonValue)
Some objects such as Boolean() do not implement the Comparator interface and so equals comparisons could not be called, so when an Object that doesn't implement Comparator is passed with a type of =, or == this method was created. Any other argument such as <, >, <= doesn't make sense unless the Comparator is implemented however, and so a RuntimeException is thrown in this case. Serveral Conditionals are created with by chaining Conditionals together with the decorator pattern. For example any not Conditional such as "!=" and "not like" simply decorates the underlying Conditional with the NegateCondtional object.