Class MeasureType
java.lang.Object
dev.jcputney.elearning.parser.input.scorm2004.ims.ss.types.MeasureType
- All Implemented Interfaces:
Serializable
Represents a decimal measure with a value between -1 and 1, inclusive, with at least four
significant decimal digits.
This type enforces the range and precision for a measure as defined in the XML schema. Valid values for this type fall within the range of -1 to 1.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the MeasureType class.MeasureType(BigDecimal value) Constructs a MeasureType instance with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionstatic MeasureTypeParses a string as a MeasureType.toString()Returns the string representation of the measure value, formatted to at least four decimal places.
-
Constructor Details
-
MeasureType
public MeasureType()Default constructor for the MeasureType class. -
MeasureType
Constructs a MeasureType instance with the specified value.- Parameters:
value- the decimal value for the measure must be between -1 and 1 with at least four decimal digits.- Throws:
IllegalArgumentException- if the value is out of range or does not have at least four decimal digits.
-
-
Method Details
-
parse
Parses a string as a MeasureType.- Parameters:
value- the string representation of the measure must represent a decimal between -1 and 1.- Returns:
- a new MeasureType instance.
- Throws:
IllegalArgumentException- if the value is out of range or not a valid decimal format.
-
toString
Returns the string representation of the measure value, formatted to at least four decimal places.
-