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 TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.getName()final inthashCode()Returns a hash code value for this object.node()Returns the value of thenoderecord component.priority()Returns the value of thepriorityrecord component.sign()Returns the value of thesignrecord 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 aOperatorrecord 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:
compareToin 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 thesignrecord component.- Returns:
- the value of the
signrecord component
-
priority
Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
node
Returns the value of thenoderecord component.- Returns:
- the value of the
noderecord component
-