com.fdsapi.arrays
Class NegateConditional

java.lang.Object
  |
  +--com.fdsapi.arrays.NegateConditional
All Implemented Interfaces:
Conditional

public class NegateConditional
extends java.lang.Object
implements Conditional

Used in a decorator chain to Negate any other conditional. This reduces the ammount of code that must be written as != and others are simply wrapped in the NegateConditional() object and so other classes need not be created.

View Code


Constructor Summary
NegateConditional(Conditional nextConditional)
          Creates a new instance of NegateConditional, negating the Conditional that is passed in.
 
Method Summary
 java.lang.String getType()
          Returns '!' to help in creating a String representation of the Conditional
 boolean isTrue(java.lang.Object[] row)
          This method returns the opposite of the next Conditional in the chain thus negating it.
 java.lang.String toString()
          Return a String representation of this Conditional
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NegateConditional

public NegateConditional(Conditional nextConditional)
Creates a new instance of NegateConditional, negating the Conditional that is passed in. If this passed in Conditional is false then NegateConditional returns true and if it is true NegateConditional returns false.

Method Detail

isTrue

public boolean isTrue(java.lang.Object[] row)
This method returns the opposite of the next Conditional in the chain thus negating it.

Specified by:
isTrue in interface Conditional

getType

public java.lang.String getType()
Returns '!' to help in creating a String representation of the Conditional

Specified by:
getType in interface Conditional

toString

public java.lang.String toString()
Return a String representation of this Conditional

Overrides:
toString in class java.lang.Object