- All Implemented Interfaces:
Serializable,Comparable<MathOperation.Operator>,Constable
- Enclosing class:
MathOperation
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAddition operator for mathematical calculations.Division operator for mathematical calculations.Modulo operator for mathematical calculations.Multiplication operator for mathematical calculations.Subtraction operator for mathematical calculations. -
Method Summary
Modifier and TypeMethodDescriptionsymbol()Retrieves the symbol representing this operator.static MathOperation.OperatorReturns the enum constant of this class with the specified name.static MathOperation.Operator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD
Addition operator for mathematical calculations.The operator symbol is "+".
-
SUBTRACT
Subtraction operator for mathematical calculations.The operator symbol is "-".
-
MULTIPLY
Multiplication operator for mathematical calculations.The operator symbol is "*".
-
DIVIDE
Division operator for mathematical calculations.The operator symbol is "/".
-
MOD
Modulo operator for mathematical calculations.The operator symbol is "%".
-
-
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
Retrieves the symbol representing this operator.- Returns:
- the operator's symbolic representation as a string.
-