net.sf.doolin.gui.display
Enum ConditionalOperator

java.lang.Object
  extended by java.lang.Enum<ConditionalOperator>
      extended by net.sf.doolin.gui.display.ConditionalOperator
All Implemented Interfaces:
Serializable, Comparable<ConditionalOperator>

public enum ConditionalOperator
extends Enum<ConditionalOperator>

Operator that evaluates to boolean results.

Author:
Damien Coraboeuf

Enum Constant Summary
BLANK
          Evaluates to true if value as a string is blank.
BOOLEAN_FALSE
          Evaluates to true if value can be evaluated to a boolean that is false.
BOOLEAN_TRUE
          Evaluates to true if value can be evaluated to a boolean that is true.
EQ
          Evaluates to true if value is equal to the operand.
EQ_STR
          Evaluates to true if value is equal to the operand when comparing their String representation.
GT
          Evaluates to true if value is greater than the operand.
GTE
          Evaluates to true if value is greater or equal than the operand.
LT
          Evaluates to true if value is less than the operand.
LTE
          Evaluates to true if value is less or equal than the operand.
NEQ
          Evaluates to true if value is not equal to the operand.
NOT_BLANK
          Evaluates to true if value as a string is not blank.
NOT_NULL
          Evaluates to true if value is not null.
NULL
          Evaluates to true if value is * null.
 
Method Summary
abstract  boolean evaluate(Object value, Object operand)
          Evaluates the operator with the value and the operand.
static ConditionalOperator valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ConditionalOperator[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOT_NULL

public static final ConditionalOperator NOT_NULL
Evaluates to true if value is not null. The operand is not used.


NULL

public static final ConditionalOperator NULL
Evaluates to true if value is * null. The operand is not used.


NOT_BLANK

public static final ConditionalOperator NOT_BLANK
Evaluates to true if value as a string is not blank. The operand is not used.


BLANK

public static final ConditionalOperator BLANK
Evaluates to true if value as a string is blank. The operand is not used.


EQ

public static final ConditionalOperator EQ
Evaluates to true if value is equal to the operand.


EQ_STR

public static final ConditionalOperator EQ_STR
Evaluates to true if value is equal to the operand when comparing their String representation.


NEQ

public static final ConditionalOperator NEQ
Evaluates to true if value is not equal to the operand.


GTE

public static final ConditionalOperator GTE
Evaluates to true if value is greater or equal than the operand.


GT

public static final ConditionalOperator GT
Evaluates to true if value is greater than the operand.


LTE

public static final ConditionalOperator LTE
Evaluates to true if value is less or equal than the operand.


LT

public static final ConditionalOperator LT
Evaluates to true if value is less than the operand.


BOOLEAN_TRUE

public static final ConditionalOperator BOOLEAN_TRUE
Evaluates to true if value can be evaluated to a boolean that is true.


BOOLEAN_FALSE

public static final ConditionalOperator BOOLEAN_FALSE
Evaluates to true if value can be evaluated to a boolean that is false.

Method Detail

values

public static ConditionalOperator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ConditionalOperator c : ConditionalOperator.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ConditionalOperator valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

evaluate

public abstract boolean evaluate(Object value,
                                 Object operand)
Evaluates the operator with the value and the operand.

Parameters:
value - Value
operand - Operand (may not be used by some operators)
Returns:
Result of the evaluation


Copyright © 2011. All Rights Reserved.