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:
java.lang.Comparable<LinearUnit>
,IUnit
- Enclosing class:
- LinearUnit
protected static class LinearUnit.Custom extends 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 Modifier and Type Field Description private LinearUnit
definitionUnit
private ScaleFactor
factorToDefinition
-
Fields inherited from interface org.openjdk.jmc.common.unit.IUnit
EMPTY_STRING_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Custom(LinearKindOfQuantity kindOfQuantity, java.lang.String unitId, ScaleFactor factorToDefinition, LinearUnit definitionUnit, java.lang.String unitSymbol, java.lang.String unitDesc, java.lang.String... altNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITypedQuantity<LinearUnit>
asWellKnownQuantity()
boolean
equals(java.lang.Object other)
int
hashCode()
protected boolean
isCustom()
protected java.lang.String
localizedFormatFor(java.lang.Number numericalValue, boolean useBreakingSpace, boolean allowCustomUnit)
protected java.lang.String
persistableStringFor(java.lang.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
-
-
-
-
Field Detail
-
factorToDefinition
private final ScaleFactor factorToDefinition
-
definitionUnit
private final LinearUnit definitionUnit
-
-
Constructor Detail
-
Custom
protected Custom(LinearKindOfQuantity kindOfQuantity, java.lang.String unitId, ScaleFactor factorToDefinition, LinearUnit definitionUnit, java.lang.String unitSymbol, java.lang.String unitDesc, java.lang.String... altNames)
-
-
Method Detail
-
isCustom
protected boolean isCustom()
- Overrides:
isCustom
in classLinearUnit
-
asWellKnownQuantity
public ITypedQuantity<LinearUnit> asWellKnownQuantity()
- Overrides:
asWellKnownQuantity
in classLinearUnit
- Returns:
- a quantity with the same magnitude as this unit, defined in a non-custom unit (possibly itself)
-
persistableStringFor
protected java.lang.String persistableStringFor(java.lang.Number numericalValue)
- Overrides:
persistableStringFor
in classLinearUnit
-
localizedFormatFor
protected java.lang.String localizedFormatFor(java.lang.Number numericalValue, boolean useBreakingSpace, boolean allowCustomUnit)
- Overrides:
localizedFormatFor
in classLinearUnit
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classLinearUnit
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classLinearUnit
-
-