Record Class Operator
java.lang.Object
java.lang.Record
org.skriptlang.skript.lang.arithmetic.Operator
- Record Components:
sign
- the symbolic representation of the operator (e.g., "+", "-").node
- localized name of the operator
- All Implemented Interfaces:
Comparable<Operator>
public record Operator(String sign, Priority priority, Noun node)
extends Record
implements Comparable<Operator>
Represents an operator used in expressions.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
final boolean
Indicates whether some other object is "equal to" this one.getName()
final int
hashCode()
Returns a hash code value for this object.node()
Returns the value of thenode
record component.priority()
Returns the value of thepriority
record component.sign()
Returns the value of thesign
record component.toString()
Returns a string representation of this record class.
-
Field Details
-
ADDITION_SUBTRACTION_PRIORITY
-
MULTIPLICATION_DIVISION_PRIORITY
-
EXPONENTIATION_PRIORITY
-
ADDITION
-
SUBTRACTION
-
MULTIPLICATION
-
DIVISION
-
EXPONENTIATION
-
-
Constructor Details
-
Operator
- Parameters:
node
- resolves to 'operators.' in the lang file
-
Operator
-
Operator
-
Operator
Creates an instance of aOperator
record class.
-
-
Method Details
-
getName
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
compareTo
- Specified by:
compareTo
in interfaceComparable<Operator>
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
sign
Returns the value of thesign
record component.- Returns:
- the value of the
sign
record component
-
priority
Returns the value of thepriority
record component.- Returns:
- the value of the
priority
record component
-
node
Returns the value of thenode
record component.- Returns:
- the value of the
node
record component
-