Package com.im.df.api.dml
Class DFTermExpression
- java.lang.Object
-
- com.im.df.api.dml.DFTerm
-
- com.im.df.api.dml.DFTermExpression
-
public final class DFTermExpression extends DFTerm
This object represents a complex expression. It consists of operator and zero to more operands. In addition it can contain some options which are specific parameters to this expression. These options are not standardized.The object is immutable, the value cannot be changed once the object is created. Currently it doesn't have public constructor nor create method. If you want to use this object you can create using
DFTermsFactory
static methods.- Author:
- Petr Hamernik
-
-
Field Summary
Fields Modifier and Type Field Description static DFTermExpression
ALL_DATA
The constant which represents all data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(DFTermVisitor visitor)
DFTermExpression
changeOperator(DFOperator newOperator)
Change the operator for this expression and return new changed instance of this expression.DFTermExpression
changeOptions(java.util.Map<java.lang.String,java.lang.Object> newOptions)
Change the options of this expression.DFTermExpression
copy()
Creates a copy of thisDFTermExpression
.boolean
equals(java.lang.Object obj)
int
getIndexOfOperand(DFTerm operand)
Get index of the operand.java.util.List<DFTerm>
getOperands()
Gets the list of operands.DFOperator
getOperator()
Gets the operator.java.util.Map<java.lang.String,java.lang.Object>
getOptions()
Gets the options of the expression.int
hashCode()
boolean
isAllData()
Tells if this query represents "all data" query.java.lang.String
toString()
-
-
-
Field Detail
-
ALL_DATA
public static final DFTermExpression ALL_DATA
The constant which represents all data. In SQL it means "SELECT * FROM SOME_TABLE".
-
-
Method Detail
-
isAllData
public boolean isAllData()
Tells if this query represents "all data" query.- Returns:
true
if this query is "all data" ~ without an operand.- Since:
- 19.20.0
- See Also:
ALL_DATA
-
changeOperator
public DFTermExpression changeOperator(DFOperator newOperator)
Change the operator for this expression and return new changed instance of this expression.- Parameters:
newOperator
- New operator must be only in the same group of operators. If the previous operator was logical (AND/OR), the new one must be from the same category otherwise the method will throw an exception. The same for structural operators.- Returns:
- New expression with the same operands and the same options.
-
changeOptions
public DFTermExpression changeOptions(java.util.Map<java.lang.String,java.lang.Object> newOptions)
Change the options of this expression. As this object immutable it returns a new instance with changed options- Parameters:
newOptions
- New options- Returns:
- The new instance of DFTermExpression with replaced options.
-
copy
public DFTermExpression copy()
Creates a copy of thisDFTermExpression
.- Returns:
- A copy of this
DFTermExpression
. - Since:
- 16.4.18
-
getOperator
public DFOperator getOperator()
Gets the operator.- Returns:
- Operator for this expression. Never returns null.
-
getOperands
public java.util.List<DFTerm> getOperands()
Gets the list of operands.- Returns:
- The list of operands. Never returns null.
-
getIndexOfOperand
public int getIndexOfOperand(DFTerm operand)
Get index of the operand.- Parameters:
operand
- The operand which you are looking for- Returns:
- The index of the given operand or -1 if the operand cannot be found.
-
getOptions
public java.util.Map<java.lang.String,java.lang.Object> getOptions()
Gets the options of the expression.- Returns:
- The options
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public void accept(DFTermVisitor visitor)
-
-