public interface IUnit
Modifier and Type | Field and Description |
---|---|
static String[] |
EMPTY_STRING_ARRAY |
Modifier and Type | Method and Description |
---|---|
String[] |
getAltLocalizedNames()
Get alternate names for content assist matching.
|
String |
getAppendableSuffix(boolean useBreakingSpace)
Convenience method for (localized) formatters, to prepend a space to
getLocalizedSymbol() , if needed. |
KindOfQuantity<?> |
getContentType()
Get the kind of quantity of this unit.
|
LinearUnit |
getDeltaUnit()
Get the unit that the difference between two quantities in this unit will have.
|
String |
getIdentifier()
Persistable identifier, not to show interactively.
|
String |
getLocalizedDescription()
In the real world, units are sometimes used ambiguously (like MB).
|
String |
getLocalizedSymbol()
Symbols for units are most often not locale dependent, but there are exceptions (like in
French).
|
boolean |
isLinear()
If this unit is linear.
|
IQuantity |
quantity(double numericalValue)
Create a quantity expressed in this unit and with a numerical quantity value equal to
numericalValue . |
IQuantity |
quantity(long numericalValue)
Create a quantity expressed in this unit and with a numerical quantity value equal to
numericalValue . |
IQuantity |
quantity(Number numericalValue)
Create a quantity expressed in this unit and with a numerical quantity value equal to
numericalValue . |
IScalarAffineTransform |
valueTransformTo(IUnit targetUnit)
Get a transform for transforming numerical quantity values expressed in this unit to
numerical quantity values expressed in
targetUnit . |
static final String[] EMPTY_STRING_ARRAY
KindOfQuantity<?> getContentType()
IQuantity quantity(Number numericalValue)
numericalValue
.IQuantity quantity(long numericalValue)
numericalValue
.IQuantity quantity(double numericalValue)
numericalValue
.IScalarAffineTransform valueTransformTo(IUnit targetUnit)
targetUnit
. This method is typically only used
internally by the quantity implementations.IllegalArgumentException
- if targetUnit
is not of the same kind of quantityboolean isLinear()
true
if and only if the unit is linearLinearUnit getDeltaUnit()
String getIdentifier()
String getLocalizedSymbol()
While symbols normally don't contain any white space, spacing occur in circumstances like
custom units. In this case, it is important that they are non-breaking spaces
(
).
String getAppendableSuffix(boolean useBreakingSpace)
getLocalizedSymbol()
, if needed.useBreakingSpace
- to use breaking space instead of the default, non-breaking space (only for edit)String getLocalizedDescription()
String[] getAltLocalizedNames()
null
.Copyright © 2019. All rights reserved.