Enum Class SafeInteger

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

public enum SafeInteger extends Enum<SafeInteger> implements ValueAccessor<Long>
The SafeInteger interface defines some constants of interest related to the various number types available.
  • 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 ValueAccessor<Long>