Enum MeasurementPrecision
-
- All Implemented Interfaces:
public enum MeasurementPrecision
Number of decimal points for annotation float value rounding.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description WHOLE
For example: "1"
ONE_DP
For example: "0.1"
TWO_DP
For example: "0.01"
THREE_DP
For example: "0.001"
FOUR_DP
For example: "0.0001"
WHOLE_INCH
Available for inches, feet, and yards output units. See: Scale.UnitTo. Provides fractional precision for inches: "1 ft 1 in"
HALVES_INCH
Available for inches, feet, and yards output units. See: Scale.UnitTo. Provides fractional precision for inches: "1 ft 1/2 in"
QUARTERS_INCH
Available for inches, feet, and yards output units. See: Scale.UnitTo. Provides fractional precision for inches: "1 ft 1/4 in"
EIGHTHS_INCH
Available for inches, feet, and yards output units. See: Scale.UnitTo. Provides fractional precision for inches: "1 ft 1/8 in"
SIXTEENTHS_INCH
Available for inches, feet, and yards output units. See: Scale.UnitTo. Provides fractional precision for inches: "1 ft 1/16 in"
-
Method Summary
Modifier and Type Method Description static MeasurementPrecision
fromString(String s)
static String
toDisplayString(@NonNull() MeasurementPrecision precision)
Returns a formatted version of the enum to be used for UI selectors or other display purposes. static MeasurementPrecision
precisionFromDisplayString(String str)
Returns a MeasurementPrecision based on the display string passed or null if it can't be found. static Array<MeasurementPrecision>
values()
Returns an array containing the constants of this enum type, in the order they're declared. static MeasurementPrecision
valueOf(String name)
Returns the enum constant of this type with the specified name. -
-
Method Detail
-
fromString
static MeasurementPrecision fromString(String s)
-
toDisplayString
static String toDisplayString(@NonNull() MeasurementPrecision precision)
Returns a formatted version of the enum to be used for UI selectors or other display purposes.
- Parameters:
precision
- The enum- Returns:
A displayable string.
-
precisionFromDisplayString
@Nullable() static MeasurementPrecision precisionFromDisplayString(String str)
Returns a MeasurementPrecision based on the display string passed or null if it can't be found. Uses the same mapping as toDisplayString
- Parameters:
str
- Display string- Returns:
The MeasurementPrecision or null if not found.
-
values
static Array<MeasurementPrecision> values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.
- Returns:
an array containing the constants of this enum type, in the order they're declared
-
valueOf
static MeasurementPrecision valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
- Returns:
the enum constant with the specified name
-
-
-
-