Package org.scijava.parse
Class Operator
java.lang.Object
org.scijava.parse.Token
org.scijava.parse.Operator
- All Implemented Interfaces:
Comparable<Operator>
A mathematical operator is a "verb": a special infix (in the case of binary
or greater arity) or prefix (in the case of unary) symbol which defines a
relation between "nouns" (i.e.: literals and variables).
- Author:
- Curtis Rueden
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionOperator(String symbol, int arity, Operator.Associativity associativity, double precedence) -
Method Summary
Modifier and TypeMethodDescriptionintintgetArity()1 for unary, 2 for binary, etc.doubleinstance()booleanisInfix()True iff the operator is an infix operator (e.g.,a-b).booleanbooleanTrue iff the operator is a postfix operator (e.g.,a').booleanisPrefix()True iff the operator is a prefix operator (e.g.,-a).boolean
-
Constructor Details
-
Operator
-
-
Method Details
-
getArity
public int getArity()1 for unary, 2 for binary, etc. -
getAssociativity
-
isLeftAssociative
public boolean isLeftAssociative() -
isRightAssociative
public boolean isRightAssociative() -
isInfix
public boolean isInfix()True iff the operator is an infix operator (e.g.,a-b). -
isPrefix
public boolean isPrefix()True iff the operator is a prefix operator (e.g.,-a). -
isPostfix
public boolean isPostfix()True iff the operator is a postfix operator (e.g.,a'). -
getPrecedence
public double getPrecedence() -
instance
-
compareTo
- Specified by:
compareToin interfaceComparable<Operator>
-