Package org.openjdk.jmc.common.unit
Class LinearKindOfQuantity.AutoFormatter
- java.lang.Object
-
- org.openjdk.jmc.common.unit.DisplayFormatter<IQuantity>
-
- org.openjdk.jmc.common.unit.LinearKindOfQuantity.AutoFormatter
-
- All Implemented Interfaces:
IFormatter<IQuantity>
- Enclosing class:
- LinearKindOfQuantity
public static class LinearKindOfQuantity.AutoFormatter extends DisplayFormatter<IQuantity>
-
-
Field Summary
Fields Modifier and Type Field Description protected double
maxNumericalValue
protected double
minNumericalValue
protected int
nominalValueDigits
-
Fields inherited from class org.openjdk.jmc.common.unit.DisplayFormatter
ENGINEERING_NOTATION_IDENTIFIER, SCIENTIFIC_NOTATION_IDENTIFIER
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AutoFormatter(LinearKindOfQuantity kindOfQuantity, String name)
protected
AutoFormatter(LinearKindOfQuantity kindOfQuantity, String name, double minNumericalValue, double maxNumericalValue)
protected
AutoFormatter(LinearKindOfQuantity kindOfQuantity, String id, String name, double minNumericalValue, double maxNumericalValue, int nominalValueDigits)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(IQuantity quantity)
static String
formatInUnit(IQuantity quantity, LinearUnit customUnit, int nominalValueDigits)
protected static String
formatWithFixedFraction(Number numValue, LinearUnit customUnit, int numFractionDigits)
protected static String
formatWithUnit(Number numValue, LinearUnit customUnit, int nominalValueDigits)
LinearKindOfQuantity
getContentType()
-
Methods inherited from class org.openjdk.jmc.common.unit.DisplayFormatter
getIdentifier, getName
-
-
-
-
Constructor Detail
-
AutoFormatter
protected AutoFormatter(LinearKindOfQuantity kindOfQuantity, String name)
-
AutoFormatter
protected AutoFormatter(LinearKindOfQuantity kindOfQuantity, String name, double minNumericalValue, double maxNumericalValue)
-
AutoFormatter
protected AutoFormatter(LinearKindOfQuantity kindOfQuantity, String id, String name, double minNumericalValue, double maxNumericalValue, int nominalValueDigits)
-
-
Method Detail
-
getContentType
public LinearKindOfQuantity getContentType()
- Overrides:
getContentType
in classDisplayFormatter<IQuantity>
-
format
public String format(IQuantity quantity)
- Specified by:
format
in interfaceIFormatter<IQuantity>
- Overrides:
format
in classDisplayFormatter<IQuantity>
-
formatInUnit
public static String formatInUnit(IQuantity quantity, LinearUnit customUnit, int nominalValueDigits)
-
formatWithUnit
protected static String formatWithUnit(Number numValue, LinearUnit customUnit, int nominalValueDigits)
-
formatWithFixedFraction
protected static String formatWithFixedFraction(Number numValue, LinearUnit customUnit, int numFractionDigits)
-
-