| Modifier and Type | Field and Description |
|---|---|
| private int | dimensionality
Determine the power of the |
| private int | index
Simple unit index, unique for every simple unit, -1 for the dimensionless unit. |
| private String | simpleUnitID
SimpleUnit is the simplest form of a Unit. |
| private MeasureUnit. | unitPrefix
SI or binary prefix. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public MeasureUnit | |
| pack-priv int | compareTo(SingleUnitImpl other)
Compare this SingleUnitImpl to another SingleUnitImpl for the sake of sorting and coalescing. |
| public SingleUnitImpl | |
| public int | |
| public int | |
| public String | getNeutralIdentifier()
Generates a neutral identifier string for a single unit which means we do not include the dimension signal. |
| public MeasureUnit. | |
| public String | |
| pack-priv boolean | isCompatibleWith(SingleUnitImpl other)
Checks whether this SingleUnitImpl is compatible with another for the purpose of coalescing. |
| public void | |
| public void | |
| public void |
| dimensionality | back to summary |
|---|---|
| private int dimensionality Determine the power of the Note Default dimensionality is 1. | |
| index | back to summary |
|---|---|
| private int index Simple unit index, unique for every simple unit, -1 for the dimensionless unit. This is an index into a string list in unit.txt {ConversionUnits}. The default value is -1, meaning the dimensionless unit: isDimensionless() will return true, until index is changed. | |
| simpleUnitID | back to summary |
|---|---|
| private String simpleUnitID SimpleUnit is the simplest form of a Unit. For example, for "square-millimeter", the simple unit would be "meter"Ò The default value is "", meaning the dimensionless unit: isDimensionless() will return true, until index is changed. | |
| unitPrefix | back to summary |
|---|---|
| private MeasureUnit. SI or binary prefix. | |
| SingleUnitImpl | back to summary |
|---|---|
| public SingleUnitImpl() | |
| build | back to summary |
|---|---|
| public MeasureUnit build() | |
| compareTo | back to summary |
|---|---|
| pack-priv int compareTo(SingleUnitImpl other) Compare this SingleUnitImpl to another SingleUnitImpl for the sake of sorting and coalescing. Sort order of units is specified by UTS #35 (https://unicode.org/reports/tr35/tr35-info.html#Unit_Identifier_Normalization). Takes the sign of dimensionality into account, but not the absolute value: per-meter is not considered the same as meter, but meter is considered the same as square-meter. The dimensionless unit generally does not get compared, but if it did, it would sort before other units by virtue of index being < 0 and dimensionality not being negative. | |
| copy | back to summary |
|---|---|
| public SingleUnitImpl copy() | |
| getDimensionality | back to summary |
|---|---|
| public int getDimensionality() | |
| getIndex | back to summary |
|---|---|
| public int getIndex() | |
| getNeutralIdentifier | back to summary |
|---|---|
| public String getNeutralIdentifier() Generates a neutral identifier string for a single unit which means we do not include the dimension signal. | |
| getPrefix | back to summary |
|---|---|
| public MeasureUnit. | |
| getSimpleUnitID | back to summary |
|---|---|
| public String getSimpleUnitID() | |
| isCompatibleWith | back to summary |
|---|---|
| pack-priv boolean isCompatibleWith(SingleUnitImpl other) Checks whether this SingleUnitImpl is compatible with another for the purpose of coalescing. Units with the same base unit and SI or binary prefix should match, except that they must also have the same dimensionality sign, such that we don't merge numerator and denominator. | |
| setDimensionality | back to summary |
|---|---|
| public void setDimensionality(int dimensionality) | |
| setPrefix | back to summary |
|---|---|
| public void setPrefix(MeasureUnit. | |
| setSimpleUnit | back to summary |
|---|---|
| public void setSimpleUnit(int simpleUnitIndex, String[] simpleUnits) | |