Class AbstractOperator
java.lang.Object
com.scriptbasic.executors.AbstractExpression
com.scriptbasic.executors.operators.AbstractOperator
- All Implemented Interfaces:
AnalysisResult,Evaluator,Expression
- Direct Known Subclasses:
AbstractBinaryOperator,AbstractUnaryOperator
public abstract class AbstractOperator extends AbstractExpression
-
Constructor Summary
Constructors Constructor Description AbstractOperator() -
Method Summary
Modifier and Type Method Description protected static java.lang.BooleangetAsBoolean(RightValue op)Try to convert operator to booleanprotected static java.lang.DoublegetAsDouble(RightValue op)Try to convert operator to doubleprotected static java.lang.LonggetAsLong(RightValue op)Try to convert operator to longprotected static java.lang.ObjectgetAsObject(RightValue op)Try to convert operator to java objectprotected static java.lang.StringgetAsString(RightValue op)Try to convert operator to string
-
Constructor Details
-
AbstractOperator
public AbstractOperator()
-
-
Method Details
-
getAsDouble
Try to convert operator to double- Parameters:
op- operator- Returns:
- Return double or null if cannot be converted
-
getAsLong
Try to convert operator to long- Parameters:
op- operator- Returns:
- Return long or null if cannot be converted
-
getAsBoolean
Try to convert operator to boolean- Parameters:
op- operator- Returns:
- Return boolean or null if cannot be converted
-
getAsString
Try to convert operator to string- Parameters:
op- operator- Returns:
- Return string or null if cannot be converted
-
getAsObject
Try to convert operator to java object- Parameters:
op- operator- Returns:
- Return object or null if cannot be converted
-