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.Boolean getAsBoolean​(RightValue op)
    Try to convert operator to boolean
    protected static java.lang.Double getAsDouble​(RightValue op)
    Try to convert operator to double
    protected static java.lang.Long getAsLong​(RightValue op)
    Try to convert operator to long
    protected static java.lang.Object getAsObject​(RightValue op)
    Try to convert operator to java object
    protected static java.lang.String getAsString​(RightValue op)
    Try to convert operator to string

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.scriptbasic.interfaces.Evaluator

    evaluate
  • Constructor Details

  • Method Details

    • getAsDouble

      protected static java.lang.Double getAsDouble​(RightValue op)
      Try to convert operator to double
      Parameters:
      op - operator
      Returns:
      Return double or null if cannot be converted
    • getAsLong

      protected static java.lang.Long getAsLong​(RightValue op)
      Try to convert operator to long
      Parameters:
      op - operator
      Returns:
      Return long or null if cannot be converted
    • getAsBoolean

      protected static java.lang.Boolean getAsBoolean​(RightValue op)
      Try to convert operator to boolean
      Parameters:
      op - operator
      Returns:
      Return boolean or null if cannot be converted
    • getAsString

      protected static java.lang.String getAsString​(RightValue op)
      Try to convert operator to string
      Parameters:
      op - operator
      Returns:
      Return string or null if cannot be converted
    • getAsObject

      protected static java.lang.Object getAsObject​(RightValue op)
      Try to convert operator to java object
      Parameters:
      op - operator
      Returns:
      Return object or null if cannot be converted