query
Class Equals

java.lang.Object
  extended byquery.RelationalOperator
      extended byquery.Equals
All Implemented Interfaces:
Operator

public class Equals
extends RelationalOperator

This class is a wrapper for equals operator ( == ). Takes field and Comparable objects as parameters in the constructor and returs true if the field of the object is equal to the Comparable object, else returns false.


Field Summary
 
Fields inherited from class query.RelationalOperator
booleanFixedData, fieldName, fixedData, isBoolean
 
Constructor Summary
Equals(java.lang.String fieldName, boolean booleanFixedData)
          creates a new Equals object.
Equals(java.lang.String fieldName, java.lang.Comparable fixedData)
          creates a new Equals object.
 
Method Summary
 boolean getResult(java.lang.Object object)
          returns true if the field of the object is equal to the Comparable object/boolean data, else returns false.
 java.lang.String toString()
          returns the equality condition being checked using fieldName and fixedData
 
Methods inherited from class query.RelationalOperator
compare
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Equals

public Equals(java.lang.String fieldName,
              java.lang.Comparable fixedData)
creates a new Equals object.

Parameters:
fieldName - field which has to be compared.
fixedData - compare value.

Equals

public Equals(java.lang.String fieldName,
              boolean booleanFixedData)
creates a new Equals object. Since Boolean object is not Comparable, use this constructor to check boolean values.

Parameters:
fieldName - field which has to be compared.
booleanFixedData - compare value.
Method Detail

getResult

public boolean getResult(java.lang.Object object)
returns true if the field of the object is equal to the Comparable object/boolean data, else returns false.

Parameters:
object - object
Returns:
true if the field of the object is equal to the Comparable object/boolean data, else returns false.

toString

public java.lang.String toString()
returns the equality condition being checked using fieldName and fixedData

Returns:
String - Equality condition