Enum Class SafeInteger

java.lang.Object
java.lang.Enum<SafeInteger>
org.refcodes.data.SafeInteger
All Implemented Interfaces:
Serializable, Comparable<SafeInteger>, Constable, org.refcodes.mixin.ValueAccessor<Long>

public enum SafeInteger extends Enum<SafeInteger> implements 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 Constants
    Enum Constant
    Description
    The 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

    Fields
    Modifier and Type
    Field
    Description
    static int
    The number of bytes required to store a value in the bounds [MIN_SAFE_INTEGER..MAX_SAFE_INTEGER].
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static SafeInteger[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.refcodes.mixin.ValueAccessor

    getValueOr, hasValue
  • Enum Constant Details

    • MIN_SAFE_INTEGER

      public static final SafeInteger 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

      public static final SafeInteger 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

  • Method Details

    • values

      public static SafeInteger[] 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

      public static SafeInteger valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getValue

      public Long getValue()
      Specified by:
      getValue in interface org.refcodes.mixin.ValueAccessor<Long>