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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static BooleanTry to convert operator to booleanprotected static DoubleTry to convert operator to doubleprotected static LonggetAsLong(RightValue op) Try to convert operator to longprotected static ObjectTry to convert operator to java objectprotected static StringTry 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
-