# Uses of Enum Class
com.norconex.commons.lang.unit.DataUnit

Packages that use DataUnit
Package
Description
com.norconex.commons.lang.unit
Classes making it easier to deal with unit conversions and formatting.
com.norconex.commons.lang.xml
XML-related classes.

- ## Uses of DataUnit in com.norconex.commons.lang.unit

  Fields in com.norconex.commons.lang.unit with type parameters of type DataUnit
  Modifier and Type
  Field
  Description
  `static final List<DataUnit>`
  DataUnit.`BINARY_BIT_UNITS`
  `static final List<DataUnit>`
  DataUnit.`BINARY_BYTE_UNITS`
  `static final List<DataUnit>`
  DataUnit.`DECIMAL_BIT_UNITS`
  `static final List<DataUnit>`
  DataUnit.`DECIMAL_BYTE_UNITS`
  Methods in com.norconex.commons.lang.unit that return DataUnit
  Modifier and Type
  Method
  Description
  `static DataUnit`
  DataUnit.`from(String dataUnit)`
  Gets the unit value representing the given text.
  `static DataUnit`
  DataUnit.`valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static DataUnit[]`
  DataUnit.`values()`
  Returns an array containing the constants of this enum class, in the order they are declared.
  Methods in com.norconex.commons.lang.unit with parameters of type DataUnit
  Modifier and Type
  Method
  Description
  `String`
  DataUnitFormatter.`format(double amount, DataUnit unit)`
  Formats a data amount of the given unit to a human-readable representation.
  `String`
  DataUnitFormatter.`format(BigDecimal amount, DataUnit unit)`
  Formats a data amount of the given unit to a human-readable representation.
  `BigDecimal`
  DataUnit.`from(double sourceAmount, DataUnit sourceUnit)`
  Converts an amount of a specific unit to this unit.
  `BigDecimal`
  DataUnit.`from(BigDecimal sourceAmount, DataUnit sourceUnit)`
  Converts an amount of a specific unit to this unit.
  `static BigDecimal`
  DataUnitParser.`parse(String text, DataUnit targetUnit)`
  Parses a text representation of a data measurement.
  `static BigDecimal`
  DataUnitParser.`parse(String text, DataUnit targetUnit, BigDecimal defaultValue)`
  Parses a text representation of a data measurement.
  `BigDecimal`
  DataUnit.`to(double sourceAmount, DataUnit targetUnit)`
  `BigDecimal`
  DataUnit.`to(BigDecimal sourceAmount, DataUnit targetUnit)`

- ## Uses of DataUnit in com.norconex.commons.lang.xml

  Methods in com.norconex.commons.lang.xml with parameters of type DataUnit
  Modifier and Type
  Method
  Description
  `Long`
  Xml.`getDataSize(String xpathExpression, DataUnit targetUnit, Long defaultValue)`
  Gets the size of a data expression, in the specified target unit (e.g., 2KB, 1GiB, 3 megabytes, etc).