public class Operator extends Token implements Comparable<Operator>
Modifier and Type | Class and Description |
---|---|
static class |
Operator.Associativity |
Constructor and Description |
---|
Operator(String symbol,
int arity,
Operator.Associativity associativity,
double precedence) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Operator that) |
int |
getArity()
1 for unary, 2 for binary, etc.
|
Operator.Associativity |
getAssociativity() |
double |
getPrecedence() |
Operator |
instance() |
boolean |
isInfix()
True iff the operator is an infix operator (e.g.,
a-b ). |
boolean |
isLeftAssociative() |
boolean |
isPostfix()
True iff the operator is a postfix operator (e.g.,
a' ). |
boolean |
isPrefix()
True iff the operator is a prefix operator (e.g.,
-a ). |
boolean |
isRightAssociative() |
public Operator(String symbol, int arity, Operator.Associativity associativity, double precedence)
public int getArity()
public Operator.Associativity getAssociativity()
public boolean isLeftAssociative()
public boolean isRightAssociative()
public boolean isInfix()
a-b
).public boolean isPrefix()
-a
).public boolean isPostfix()
a'
).public double getPrecedence()
public Operator instance()
public int compareTo(Operator that)
compareTo
in interface Comparable<Operator>
Copyright © 2015–2022 SciJava. All rights reserved.