Package com.mckoi.database
Class Operator
java.lang.Object
com.mckoi.database.Operator
- All Implemented Interfaces:
Serializable
An operator for an expression.
- Author:
- Tobias Downer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract TObject
eval
(TObject ob1, TObject ob2, GroupResolver group, VariableResolver resolver, QueryContext context) static Operator
Returns an Operator with the given string.getSubQueryForm
(int type) Returns the ANY or ALL form of this operator.getSubQueryForm
(String type_str) Same as above only it handles the type as a string.inverse()
Returns the inverse operator of this operator.boolean
Returns true if this operator is equal to the operator string.boolean
boolean
boolean
boolean
isNot()
boolean
Returns true if this operator is not inversible.boolean
boolean
boolean
isSubQueryForm
(int type) Given a parameter of either NONE, ANY, ALL or SINGLE, this returns true if this operator is of the given type.int
The type of object this Operator evaluates to.reverse()
Returns an Operator that is the reverse of this Operator.toString()
-
Field Details
-
NONE
public static final int NONEThe ANY and ALL enumerator.- See Also:
-
ANY
public static final int ANYThe ANY and ALL enumerator.- See Also:
-
ALL
public static final int ALLThe ANY and ALL enumerator.- See Also:
-
-
Constructor Details
-
Operator
Constructs the Operator. -
Operator
-
Operator
-
-
Method Details
-
is
Returns true if this operator is equal to the operator string. -
eval
public abstract TObject eval(TObject ob1, TObject ob2, GroupResolver group, VariableResolver resolver, QueryContext context) -
precedence
public int precedence() -
isCondition
public boolean isCondition() -
isMathematical
public boolean isMathematical() -
isPattern
public boolean isPattern() -
isLogical
public boolean isLogical() -
isNot
public boolean isNot() -
isSubQuery
public boolean isSubQuery() -
reverse
Returns an Operator that is the reverse of this Operator. This is used for reversing a conditional expression. eg. 9 > id becomes id invalid input: '<' 9. -
isNotInversible
public boolean isNotInversible()Returns true if this operator is not inversible. -
inverse
Returns the inverse operator of this operator. For example, = becomes invalid input: '<'>, > becomes invalid input: '<'=, AND becomes OR. -
isSubQueryForm
public boolean isSubQueryForm(int type) Given a parameter of either NONE, ANY, ALL or SINGLE, this returns true if this operator is of the given type. -
getSubQueryForm
Returns the ANY or ALL form of this operator. -
getSubQueryForm
Same as above only it handles the type as a string. -
returnTType
The type of object this Operator evaluates to. -
toString
-
equals
-
get
Returns an Operator with the given string.
-