Package com.tnsai.annotations
Enum Class Effect.Operation
- All Implemented Interfaces:
Serializable,Comparable<Effect.Operation>,Constable
- Enclosing class:
Effect
Effect operations for state modification.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAdd value to numeric state.Append to list/collection state.Clear state (set to null/empty/zero).Decrement numeric state by 1.Divide numeric state by value.Increment numeric state by 1.Multiply numeric state by value.Remove from list/collection state.Set state to the specified value.Subtract value from numeric state.Toggle boolean state. -
Method Summary
Modifier and TypeMethodDescriptionstatic Effect.OperationReturns the enum constant of this class with the specified name.static Effect.Operation[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
SET
Set state to the specified value.Example:
state = ALIVE -
ADD
Add value to numeric state.Example:
count = count + value -
SUBTRACT
Subtract value from numeric state.Example:
energy = energy - value -
MULTIPLY
Multiply numeric state by value.Example:
score = score * value -
DIVIDE
Divide numeric state by value.Example:
ratio = total / value -
TOGGLE
Toggle boolean state.Example:
isActive = !isActive -
CLEAR
Clear state (set to null/empty/zero). -
INCREMENT
Increment numeric state by 1.Example:
counter++ -
DECREMENT
Decrement numeric state by 1.Example:
counter-- -
APPEND
Append to list/collection state.Example:
history.add(value) -
REMOVE
Remove from list/collection state.Example:
history.remove(value)
-
-
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
-