Enum Class CompareUtil.Operator
- All Implemented Interfaces:
Serializable, Comparable<CompareUtil.Operator>, Constable
- Enclosing class:
CompareUtil
Comparison operators.
比较运算符。
- Since:
- JDK 25, opencode-base-core V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanevaluate(int comparison) Evaluate the comparison result against this operator.symbol()Get the symbol representation.static CompareUtil.OperatorReturns the enum constant of this class with the specified name.static CompareUtil.Operator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LT
-
LE
-
EQ
-
NE
-
GE
-
GT
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
symbol
-
evaluate
public abstract boolean evaluate(int comparison) Evaluate the comparison result against this operator. 根据此运算符评估比较结果。- Parameters:
comparison- the result of compareTo (negative, 0, or positive)- Returns:
- true if the comparison satisfies this operator
-