com.im.df.api 5.9

com.im.df.api.dml
Class Operators

java.lang.Object
  extended by com.im.df.api.dml.Operators

public class Operators
extends Object

The well known built-in operators for DFTermExpression.


Nested Class Summary
static class Operators.AllDataOperator
          Represents all data
static class Operators.BetweenOperator
          A special class for Between operator
static class Operators.ErrorOperator
          A special class for "ERROR" operator.
static class Operators.IgnoreOperator
          A special class for dumb IGNORE operator
static class Operators.ListOperator
          IN LIST and NOT IN LIST operators
static class Operators.NullOperator
          IS NULL/ IS NOT NULL operators
static class Operators.SimpleFieldValuesOperator
          Currently we support only "Field Operator [Value, [Value, ...]]" formats.
static class Operators.SimpleLogicalOperator
          Class for AND/OR operators
static class Operators.SimpleTextOperator
           
static class Operators.StructureOperator
          Class for all Structure based operators
 
Field Summary
static DFOperator ALL_DATA
          A special operator without operands which represents all data (SELECT * FROM ...).
static DFOperator AND
          Logical AND operator.
static DFOperator BETWEEN
          Between operator - works for text, int, date and float
static DFOperator CONTAINS
          CONTAINS text based operator (a short cut for LIKE '%foo%')
static DFOperator ENDS_WITH
          ENDS_WITH text based operator (a short cut for LIKE '%foo')
static DFOperator EQUALS
          Equal operator - works for text, int, date
static DFOperator ERROR
          This is just an dump operator.
static DFOperator FALSE
          Unary FALSE operator - can be applied to boolean fields
static DFOperator GREATER_THAN
          Greater than operator - works for text, int, date and float
static DFOperator GREATER_THAN_OR_EQUAL
          Greater than or equal operator - works for text, int, date
static DFOperator IGNORE
          This is just dumb operator.
static DFOperator IN_LIST
          This operator takes two or more operands.
static DFOperator LESS_THAN
          Less than operator - works for text, int, date and float
static DFOperator LESS_THAN_OR_EQUAL
          Less than or equal operator - works for text, int, date
static DFOperator LIKE
          LIKE text based operator
static DFOperator NOT_EQUALS
          Not equal operator - works for text, int, date
static DFOperator NOT_IN_LIST
          This operator takes two or more operands.
static DFOperator NOT_LIKE
          NOT LIKE text based operator
static DFOperator NOT_NULL
          Unary operator - takes any field and test if the value is NOT NULL
static DFOperator NULL
          Unary operator - takes any field and test if the value is NULL
static DFOperator OR
          Logical OR operator.
static DFOperator STARTS_WITH
          STARTS_WITH text based operator (a short cut for LIKE 'foo%')
static DFOperator STRUCTURE_EXACT
          Structure search operator.
static DFOperator STRUCTURE_EXACT_FRAGMENT
          Structure search operator.
static DFOperator STRUCTURE_PERFECT
          Structure search operator.
static DFOperator STRUCTURE_SIMILARITY
          Structure search operator.
static DFOperator STRUCTURE_SUBSTRUCTURE
          Structure search operator.
static DFOperator STRUCTURE_SUPERSTRUCTURE
          Structure search operator.
static DFOperator TRUE
          Unary TRUE operator - can be applied to boolean fields
 
Constructor Summary
Operators()
           
 
Method Summary
static List<DFOperator> getAll()
          Get array of all operators currently registered into the system.
static List<DFOperator> getAllIncludingSpecial()
          Get all operators registered in the system including special operators (currently ERROR and IGNORE).
static List<DFOperator> getAllLogical()
           
static List<DFOperator> getAllStructural(DFField field)
          Get the appropriate structure search operators for the JChem table type
static List<DFOperator> getOperatorsAcceptableFor(DFField field)
           
static boolean isAndOr(DFOperator operator)
          Return true if operator is AND or OR, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUALS

public static final DFOperator EQUALS
Equal operator - works for text, int, date


NOT_EQUALS

public static final DFOperator NOT_EQUALS
Not equal operator - works for text, int, date


LESS_THAN

public static final DFOperator LESS_THAN
Less than operator - works for text, int, date and float


LESS_THAN_OR_EQUAL

public static final DFOperator LESS_THAN_OR_EQUAL
Less than or equal operator - works for text, int, date


GREATER_THAN

public static final DFOperator GREATER_THAN
Greater than operator - works for text, int, date and float


GREATER_THAN_OR_EQUAL

public static final DFOperator GREATER_THAN_OR_EQUAL
Greater than or equal operator - works for text, int, date


LIKE

public static final DFOperator LIKE
LIKE text based operator


NOT_LIKE

public static final DFOperator NOT_LIKE
NOT LIKE text based operator


STARTS_WITH

public static final DFOperator STARTS_WITH
STARTS_WITH text based operator (a short cut for LIKE 'foo%')


ENDS_WITH

public static final DFOperator ENDS_WITH
ENDS_WITH text based operator (a short cut for LIKE '%foo')


CONTAINS

public static final DFOperator CONTAINS
CONTAINS text based operator (a short cut for LIKE '%foo%')


BETWEEN

public static final DFOperator BETWEEN
Between operator - works for text, int, date and float


AND

public static final DFOperator AND
Logical AND operator. It accepts two or more operands, but the current implementation also works with a single operand (this can be changed in the future, because it's not correct).


OR

public static final DFOperator OR
Logical OR operator. It accepts two or more operands, but the current implementation also works with a single operand (this can be changed in the future, because it's not correct).


TRUE

public static final DFOperator TRUE
Unary TRUE operator - can be applied to boolean fields


FALSE

public static final DFOperator FALSE
Unary FALSE operator - can be applied to boolean fields


NULL

public static final DFOperator NULL
Unary operator - takes any field and test if the value is NULL


NOT_NULL

public static final DFOperator NOT_NULL
Unary operator - takes any field and test if the value is NOT NULL


IN_LIST

public static final DFOperator IN_LIST
This operator takes two or more operands. The first operand should be field and next operands should be values. It tests if the field value is one of the value from the list.


NOT_IN_LIST

public static final DFOperator NOT_IN_LIST
This operator takes two or more operands. The first operand should be field and next operands should be values. It tests if the field value is not one of the value from the list.


STRUCTURE_PERFECT

public static final DFOperator STRUCTURE_PERFECT
Structure search operator. The first operand must be DFField with DFFieldStructureCapability, as the second operand is expected constant Molecule value and as third operand it takes String with Chemical terms filter.


STRUCTURE_EXACT

public static final DFOperator STRUCTURE_EXACT
Structure search operator. The description is the same like STRUCTURE_PERFECT.


STRUCTURE_SUBSTRUCTURE

public static final DFOperator STRUCTURE_SUBSTRUCTURE
Structure search operator. The description is the same like STRUCTURE_PERFECT.


STRUCTURE_SUPERSTRUCTURE

public static final DFOperator STRUCTURE_SUPERSTRUCTURE
Structure search operator. The description is the same like STRUCTURE_PERFECT.


STRUCTURE_SIMILARITY

public static final DFOperator STRUCTURE_SIMILARITY
Structure search operator. The description is the same like STRUCTURE_PERFECT.


STRUCTURE_EXACT_FRAGMENT

public static final DFOperator STRUCTURE_EXACT_FRAGMENT
Structure search operator. The description is the same like STRUCTURE_PERFECT.


IGNORE

public static final DFOperator IGNORE
This is just dumb operator. It means ignore all its operands (possibly including whole subtree). Do not use this operator if you don't have really good reasons to do it. It should be removed from API


ERROR

public static final DFOperator ERROR
This is just an dump operator. It is used only for transfer of incorrect parts of expression between different UI components. For example query in form and query builder can communicate using this error operator if the query is not fully valid.


ALL_DATA

public static final DFOperator ALL_DATA
A special operator without operands which represents all data (SELECT * FROM ...). It is used by DFTermExpression.ALL_DATA

Constructor Detail

Operators

public Operators()
Method Detail

getAll

public static List<DFOperator> getAll()
Get array of all operators currently registered into the system.

TODO P2: It will be possible to register operators into the DIF when this SPI will be defined. This will be done together with new types of DFField registration.

Returns:
The list of operators. Currently returns always new instance, so you can do anything with it.

getAllIncludingSpecial

public static List<DFOperator> getAllIncludingSpecial()
Get all operators registered in the system including special operators (currently ERROR and IGNORE).

Returns:
The list of all operators

getAllStructural

public static List<DFOperator> getAllStructural(DFField field)
Get the appropriate structure search operators for the JChem table type

Parameters:
field - The structure field
Returns:
The list of valid search operators

getAllLogical

public static List<DFOperator> getAllLogical()

isAndOr

public static boolean isAndOr(DFOperator operator)
Return true if operator is AND or OR, false otherwise.

Parameters:
operator - The operator to be tested.
Returns:
True if operator is AND or OR.

getOperatorsAcceptableFor

public static List<DFOperator> getOperatorsAcceptableFor(DFField field)

com.im.df.api 5.9