com.im.df.api 14.12.15.0

com.im.df.api.dml
Class Operators.BetweenOperator

java.lang.Object
  extended by com.im.df.api.dml.DFOperator
      extended by com.im.df.api.dml.Operators.SimpleFieldValuesOperator
          extended by com.im.df.api.dml.Operators.BetweenOperator
Enclosing class:
Operators

public static class Operators.BetweenOperator
extends Operators.SimpleFieldValuesOperator

A special class for Between operator.


Constructor Summary
Operators.BetweenOperator()
           
 
Method Summary
 String getToStringPart(List<DFTerm> operands, int index)
          Get the part of the complete DFOperator.toString(java.util.List) method result.
 Object[] parseOperands(DFField field, String operands)
           
 void validate(DFDataTree dataTree, List<DFTerm> operands, Map<String,Object> options, TermErrors errors)
          Validate the operands in context of this operator.
 
Methods inherited from class com.im.df.api.dml.Operators.SimpleFieldValuesOperator
getReturnType, getValidFormatMsg, isEmptyStringAllowed, isFieldAcceptableAsOperand
 
Methods inherited from class com.im.df.api.dml.DFOperator
correctNumberOfOperands, getDisplayName, getDisplayNameInExpression, getMaxOperands, getMinOperands, getPersistName, getStartingWith, getStartingWithOperator, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operators.BetweenOperator

public Operators.BetweenOperator()
Method Detail

getToStringPart

public String getToStringPart(List<DFTerm> operands,
                              int index)
Description copied from class: DFOperator
Get the part of the complete DFOperator.toString(java.util.List) method result. This method can be overriden by subclasses so each operator can provide specific form of String representation.

For example for binary operator is this method called 3 times: for indexes 0, 1 and 2. The index=0 means it's string before the first operand, index=1 is string between operands and index=2 is after the second operand. For operator LESS_THAN it should return: index=0 => "", index=1 => " less than ", and for index=2 => "".

This method allow subclass to reuse the generic code from DFOperator.toString(java.util.List) and change the own notation (e.g. "[molW %lt; 15]" => "[%lt; moW, 15]" etc.).

Overrides:
getToStringPart in class DFOperator
Parameters:
operands - The list of all operands
index - The index of String [0..operands.size()]
Returns:
The indexed part of whole DFOperator.toString(java.util.List) method.

parseOperands

public Object[] parseOperands(DFField field,
                              String operands)
                       throws IllegalArgumentException
Overrides:
parseOperands in class Operators.SimpleFieldValuesOperator
Throws:
IllegalArgumentException

validate

public void validate(DFDataTree dataTree,
                     List<DFTerm> operands,
                     Map<String,Object> options,
                     TermErrors errors)
Description copied from class: DFOperator
Validate the operands in context of this operator. It's up to operator to decide if it accepts the given operands or not. This method is called from DFTerm.validate(com.im.df.api.ddl.DFDataTree).

Overrides:
validate in class Operators.SimpleFieldValuesOperator
Parameters:
dataTree - The datatree where this operator will be used
operands - The list of operands
options - Options of this query term (DFTermExpression.getOptions()
errors - The errors object which contains the result of the validation

com.im.df.api 14.12.15.0