Enum Class AugmentNumber
- All Implemented Interfaces:
Serializable, Comparable<AugmentNumber>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLimits the percentage to 100% maximum.Gets decimal part only and converts to percent.Keeps the decimal value as is.Multiplies the value by 100.Converts value to percentage by dividing by 2. -
Method Summary
Modifier and TypeMethodDescriptionabstract doublecalculateValue(double value) Calculates the modified value based on the enum type.static AugmentNumberReturns the enum constant of this class with the specified name.static AugmentNumber[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
MULTIPLY_BY_100
Multiplies the value by 100. Examples: - 0.25 -> 25% - 0.5 -> 50% - 1.0 -> 100% - 1.5 -> 150% -
KEEP_AS_IS
Keeps the decimal value as is. Examples: - 25.5 -> 25.5% - 100.0 -> 100.0% - 0.5 -> 0.5% - 150.75 -> 150.75% -
DECIMAL_TO_PERCENT
Gets decimal part only and converts to percent. Examples: - 1.25 -> 25% - 2.5 -> 50% - 3.75 -> 75% - 4.99 -> 99% -
SCALE_TO_PERCENT
Converts value to percentage by dividing by 2. Examples: - 2.0 -> 100% - 1.0 -> 50% - 0.5 -> 25% - 3.0 -> 150% -
CAPPED_PERCENT
Limits the percentage to 100% maximum. Examples: - 0.5 -> 50% - 1.0 -> 100% - 1.5 -> 100% - 2.0 -> 100%
-
-
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
-
calculateValue
public abstract double calculateValue(double value) Calculates the modified value based on the enum type.- Parameters:
value- The input value to be modified.- Returns:
- The calculated value.
-