Enum Operation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Operation.Companion
-
Enum Constant Summary
Enum Constants Enum Constant Description ADD
Represents the addition operation:
a + b
.SUBTRACT
Represents the subtraction operation:
a - b
.MULTIPLY
Represents the multiplication operation:
a * b
.DIVIDE
Represents the division operation,
a / b
.MODULO
Represents the modulo operation:
a % b
.ASSIGN
Represents the assignment operation, which in this case is the same as SWAP:
a = b
.LOWEST_VALUE
Returns the lowest value of the two:
min(a, b)
.MAXIMUM_VALUE
Returns the highest value of the two:
max(a, b)
.SWAP
Represents the swapping operation, which in this case is the same as ASSIGN:
a = b
.
-
Method Summary
Modifier and Type Method Description final Float
apply(Float a, Float b)
Returns the calculated number respective to the operation from two float
s: a and b.final Float
apply(Integer a, Integer b)
Returns the calculated number respective to the operation from two int
s: a and b.final Operation
valueOf(String value)
Returns the enum constant of this type with the specified name. final Array<Operation>
values()
Returns an array containing the constants of this enum type, in the order they're declared. final String
getString()
final EnumEntries<Operation>
getEntries()
Represents an operation ( +=
,-=
), and allows you to calculate the result from twofloat
s.-
-
Method Detail
-
valueOf
final Operation valueOf(String value)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
- Parameters:
value
- Represents the operation in string form, e.g.
-
values
final Array<Operation> values()
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
-
getEntries
final EnumEntries<Operation> getEntries()
Represents an operation (
+=
,-=
), and allows you to calculate the result from twofloat
s.
-
-
-
-