Package xyz.cofe.num

Enum BitCount

java.lang.Object
java.lang.Enum<BitCount>
xyz.cofe.num.BitCount
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BitCount>, java.lang.constant.Constable

public enum BitCount
extends java.lang.Enum<BitCount>
Кол-во бит на число
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum Constant Description
    BIG
    Большие числа (BigInteger/BigDecimal)
    BYTE
    1 Байт = 8 Бит
    INT
    4 Байта
    LONG
    8 Байт
    SHORT
    2 Байта
  • Field Summary

    Fields 
    Modifier and Type Field Description
    int bits
    Кол-во бит на число
  • Method Summary

    Modifier and Type Method Description
    static BitCount max​(java.lang.Number n1, java.lang.Number n2)
    Возвращает максимальное преблизительное кол-во бит для указанных чисел, если нет возможности определить of(Number): есть хоть одно значение, то испольуеться оно если отсуствуют оба, то используется INT
    static BitCount of​(java.lang.Number n)
    Возвращает приблизительное кол-во используемых бит для указанного числа
    static BitCount valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static BitCount[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • BYTE

      public static final BitCount BYTE
      1 Байт = 8 Бит
    • SHORT

      public static final BitCount SHORT
      2 Байта
    • INT

      public static final BitCount INT
      4 Байта
    • LONG

      public static final BitCount LONG
      8 Байт
    • BIG

      public static final BitCount BIG
      Большие числа (BigInteger/BigDecimal)
  • Field Details

    • bits

      public final int bits
      Кол-во бит на число
  • Method Details

    • values

      public static BitCount[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static BitCount valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • of

      public static BitCount of​(java.lang.Number n)
      Возвращает приблизительное кол-во используемых бит для указанного числа
      Parameters:
      n - число
      Returns:
      кол-во бит или null если не возможно определить
    • max

      public static BitCount max​(java.lang.Number n1, java.lang.Number n2)
      Возвращает максимальное преблизительное кол-во бит для указанных чисел, если нет возможности определить of(Number):
      • есть хоть одно значение, то испольуеться оно
      • если отсуствуют оба, то используется INT
      Parameters:
      n1 - число
      n2 - число
      Returns:
      кол-во бит