Enum Class SafeInteger
- All Implemented Interfaces:
Serializable,Comparable<SafeInteger>,Constable,org.refcodes.mixin.ValueAccessor<Long>
The
SafeInteger interface defines some constants of interest related to
the various number types available.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface org.refcodes.mixin.ValueAccessor
org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B extends org.refcodes.mixin.ValueAccessor.ValueBuilder<V, B>>, org.refcodes.mixin.ValueAccessor.ValueMutator<V>, org.refcodes.mixin.ValueAccessor.ValueProperty<V> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe maximum safe integer when floating point is involved, e.g. this maximum integer value can be stored without loss in a double value.The minimum safe integer when floating point is involved, e.g. this minimum integer can be stored without loss in a double value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe number of bytes required to store a value in the bounds [MIN_SAFE_INTEGER..MAX_SAFE_INTEGER]. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()static SafeIntegerReturns the enum constant of this class with the specified name.static SafeInteger[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface org.refcodes.mixin.ValueAccessor
getValueOr, hasValue
-
Enum Constant Details
-
MIN_SAFE_INTEGER
The minimum safe integer when floating point is involved, e.g. this minimum integer can be stored without loss in a double value. Evaluated to -2^53. -
MAX_SAFE_INTEGER
The maximum safe integer when floating point is involved, e.g. this maximum integer value can be stored without loss in a double value. Evaluates to 2^53-1.
-
-
Field Details
-
SAFE_INTEGER__BYTES
public static int SAFE_INTEGER__BYTESThe number of bytes required to store a value in the bounds [MIN_SAFE_INTEGER..MAX_SAFE_INTEGER].
-
-
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
-
getValue
-