Package org.openjdk.jmc.common.unit
Class LinearUnit.Custom
java.lang.Object
org.openjdk.jmc.common.unit.TypedUnit<LinearUnit>
org.openjdk.jmc.common.unit.LinearUnit
org.openjdk.jmc.common.unit.LinearUnit.Custom
- All Implemented Interfaces:
Comparable<LinearUnit>
,IUnit
- Enclosing class:
- LinearUnit
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openjdk.jmc.common.unit.LinearUnit
LinearUnit.Custom
Nested classes/interfaces inherited from class org.openjdk.jmc.common.unit.TypedUnit
TypedUnit.UnitSelector<U extends TypedUnit<U>>
-
Field Summary
Fields inherited from interface org.openjdk.jmc.common.unit.IUnit
EMPTY_STRING_ARRAY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Custom
(LinearKindOfQuantity kindOfQuantity, String unitId, ScaleFactor factorToDefinition, LinearUnit definitionUnit, String unitSymbol, String unitDesc, String... altNames) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
protected boolean
isCustom()
protected String
localizedFormatFor
(Number numericalValue, boolean useBreakingSpace, boolean allowCustomUnit) protected String
persistableStringFor
(Number numericalValue) Methods inherited from class org.openjdk.jmc.common.unit.LinearUnit
add, compareTo, customParseInteractive, floorQuantize, floorQuantize, getAltLocalizedNames, getAppendableSuffix, getContentType, getDeltaUnit, getIdentifier, getLocalizedDescription, getLocalizedSymbol, getScaledUnit, getUnitClass, isLinear, quantity, quantity, subtractSame, toString, valueTransformTo
Methods inherited from class org.openjdk.jmc.common.unit.TypedUnit
addPossiblyIntegral, quantity, valueTransformTo
-
Constructor Details
-
Custom
protected Custom(LinearKindOfQuantity kindOfQuantity, String unitId, ScaleFactor factorToDefinition, LinearUnit definitionUnit, String unitSymbol, String unitDesc, String... altNames)
-
-
Method Details
-
isCustom
protected boolean isCustom()- Overrides:
isCustom
in classLinearUnit
-
asWellKnownQuantity
- Overrides:
asWellKnownQuantity
in classLinearUnit
- Returns:
- a quantity with the same magnitude as this unit, defined in a non-custom unit (possibly itself)
-
persistableStringFor
- Overrides:
persistableStringFor
in classLinearUnit
-
localizedFormatFor
protected String localizedFormatFor(Number numericalValue, boolean useBreakingSpace, boolean allowCustomUnit) - Overrides:
localizedFormatFor
in classLinearUnit
-
equals
- Overrides:
equals
in classLinearUnit
-
hashCode
public int hashCode()- Overrides:
hashCode
in classLinearUnit
-