OperatorAssociativity enum
the associativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. If an operand is both preceded and followed by operators, and those operators have equal precedence, then the operand may be used as input to two different operations (i.e. the two operations indicated by the two operators). The choice of which operations to apply the operand to, is determined by the associativity of the operators.
Operators may be associative (meaning the operations can be grouped arbitrarily):
- left-associative (meaning the operations are grouped from the left)
- right-associative (meaning the operations are grouped from the right)
- non-associative (meaning operations cannot be chained, often because the output type is incompatible with the input types).
The associativity and precedence of an operator is a part of the definition of the programming language; different programming languages may have different associativity and precedence for the same type of operator.
Values
- left → const OperatorAssociativity
-
left-associative: meaning the operations are grouped from the left first This is used for the majority of operators
- right → const OperatorAssociativity
-
right-associative: meaning the operations are grouped from the right first This is used for the the power operator (2 ^ 3) or assignment (x = 12)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
OperatorAssociativity> - A constant List of the values in this enum, in order of their declaration.