Package javax.measure
Enum BinaryPrefix
- All Implemented Interfaces:
Serializable
,Comparable<BinaryPrefix>
,java.lang.constant.Constable
,Prefix
public enum BinaryPrefix extends Enum<BinaryPrefix> implements Prefix
Provides support for common binary prefixes to be used by units.
- Since:
- 2.0
- Version:
- 2.0, June 28, 2019
- Author:
- Werner Keil
- See Also:
- Wikipedia: Binary Prefix
-
Nested Class Summary
-
Enum Constant Summary
-
Method Summary
Modifier and Type Method Description static <Q extends Quantity<Q>>
Unit<Q>EXBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10246
(binary prefix).int
getExponent()
Exponent part of the associated factor inbase^exponent
representation.String
getName()
Returns the name of this prefix.String
getSymbol()
Returns the symbol of this prefix.Integer
getValue()
Base part of the associated factor inbase^exponent
representation.static <Q extends Quantity<Q>>
Unit<Q>GIBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10243
(binary prefix).static <Q extends Quantity<Q>>
Unit<Q>KIBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor1024
(binary prefix).static <Q extends Quantity<Q>>
Unit<Q>MEBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10242
(binary prefix).static <Q extends Quantity<Q>>
Unit<Q>PEBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10245
(binary prefix).static <Q extends Quantity<Q>>
Unit<Q>TEBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10244
(binary prefix).static BinaryPrefix
valueOf(String name)
Returns the enum constant of this type with the specified name.static BinaryPrefix[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.static <Q extends Quantity<Q>>
Unit<Q>YOBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10248
(binary prefix).static <Q extends Quantity<Q>>
Unit<Q>ZEBI(Unit<Q> unit)
Returns the specified unit multiplied by the factor10247
(binary prefix).
-
Enum Constant Details
-
Method Details
-
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
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
-
KIBI
Returns the specified unit multiplied by the factor1024
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1024)
.
-
MEBI
Returns the specified unit multiplied by the factor10242
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1048576)
.
-
GIBI
Returns the specified unit multiplied by the factor10243
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1073741824)
.
-
TEBI
Returns the specified unit multiplied by the factor10244
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1099511627776L)
.
-
PEBI
Returns the specified unit multiplied by the factor10245
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1125899906842624L)
.
-
EXBI
Returns the specified unit multiplied by the factor10246
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1152921504606846976L)
.
-
ZEBI
Returns the specified unit multiplied by the factor10247
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1152921504606846976d)
.
-
YOBI
Returns the specified unit multiplied by the factor10248
(binary prefix).- Type Parameters:
Q
- type of the quantity measured by the unit.- Parameters:
unit
- any unit.- Returns:
unit.multiply(1208925819614629174706176d)
.
-
getSymbol
Returns the symbol of this prefix. -
getValue
Base part of the associated factor inbase^exponent
representation. For binary prefix, this is always 1024. -
getExponent
Exponent part of the associated factor inbase^exponent
representation.- Specified by:
getExponent
in interfacePrefix
- Returns:
- the exponent part of this prefix.
-
getName
Returns the name of this prefix.
-