All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.squarespace.template.expr.OperatorToken Maven / Gradle / Ivy

There is a newer version: 2.10.0
Show newest version
package com.squarespace.template.expr;

/**
 * Token representing a unary or binary operator.
 */
public class OperatorToken extends Token {

  public final Operator value;

  public OperatorToken(Operator value) {
    super(ExprTokenType.OPERATOR);
    this.value = value;
  }

  @Override
    public boolean equals(Object obj) {
      if (obj != null && obj instanceof OperatorToken) {
        return value.type == ((OperatorToken)obj).value.type;
      }
      return false;
    }

  @Override
  public String toString() {
    return type.name() + "[" + value.type.name() + "]";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy