- java.lang.Object
-
- java.lang.Enum<BitCount>
-
- xyz.cofe.num.BitCount
-
- All Implemented Interfaces:
Serializable,Comparable<BitCount>
public enum BitCount extends Enum<BitCount>
Кол-во бит на число
-
-
Field Summary
Fields Modifier and Type Field Description intbitsКол-во бит на число
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BitCountmax(Number n1, Number n2)Возвращает максимальное преблизительное кол-во бит для указанных чисел, если нет возможности определитьof(Number): есть хоть одно значение, то испольуеться оно если отсуствуют оба, то используется INTstatic BitCountof(Number n)Возвращает приблизительное кол-во используемых бит для указанного числаstatic BitCountvalueOf(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.
-
-
-
Method Detail
-
values
public static BitCount[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BitCount c : BitCount.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BitCount valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
public static BitCount of(Number n)
Возвращает приблизительное кол-во используемых бит для указанного числа- Parameters:
n- число- Returns:
- кол-во бит или null если не возможно определить
-
max
public static BitCount max(Number n1, Number n2)
Возвращает максимальное преблизительное кол-во бит для указанных чисел, если нет возможности определитьof(Number):- есть хоть одно значение, то испольуеться оно
- если отсуствуют оба, то используется INT
- Parameters:
n1- числоn2- число- Returns:
- кол-во бит
-
-