public static class Operator.Properties extends Object
Properties
class represents the properties of an operator.Modifier and Type | Class and Description |
---|---|
static class |
Operator.Properties.Associativity
The
Associativity enum represents the associativity property of an operator.It can be of three types: LEFT associative, RIGHT associative and NO associative. |
Modifier and Type | Field and Description |
---|---|
Operator.Properties.Associativity |
associativity
The associativity of this operator.
|
Function |
function
Function implementation if this operator is a function.
Otherwise null. |
int |
params
Number of parameters required by this operator.
|
int |
precedence
The precedence of this operator.
Precedence ranges from 1 to infinity, in ascending order, i.e, with 1 being lowest precedence possible. Although parenthesis and comma have 0 precedence, they are a special case and are evaluated separately. |
Constructor and Description |
---|
Properties(int params,
int precedence)
Parameterized constructor taking number of parameters and precedence.
Associativity is set to LEFT and function is set to null. |
Properties(int params,
int precedence,
Function function)
Parameterized constructor taking number of parameters, precedence, and function.
If function is not null, associativity is set to NO, otherwise LEFT. |
Properties(int params,
int precedence,
Operator.Properties.Associativity associativity)
Parameterized constructor taking number of parameters, precedence, and associativity.
Function is set to null. |
Properties(int params,
int precedence,
Operator.Properties.Associativity associativity,
Function function)
Parameterized constructor taking number of parameters, precedence, associativity, and function.
It is recommended not to use this constructor, instead using one of the preset constructors if possible. |
public final int params
public final int precedence
public final Operator.Properties.Associativity associativity
public final Function function
public Properties(int params, int precedence)
params
- Number of parameters required by this operatorprecedence
- The precedence value of this operatorpublic Properties(int params, int precedence, Operator.Properties.Associativity associativity)
params
- Number of parameters required by this operatorprecedence
- The precedence value of this operatorassociativity
- The associativity of this operatorpublic Properties(int params, int precedence, Function function)
params
- Number of parameters required by this operatorprecedence
- The precedence value of this operatorfunction
- The function implementation for this operatorpublic Properties(int params, int precedence, Operator.Properties.Associativity associativity, Function function)
params
- Number of parameters required by this operatorprecedence
- The precedence value of this operatorassociativity
- The associativity of this operatorfunction
- The function implementation for this operatorCopyright © 2019 Pratanu Mandal. All rights reserved.