java.lang.Object
dev.jcputney.elearning.parser.input.scorm2004.ims.ss.types.MeasureType
All Implemented Interfaces:
Serializable

public class MeasureType extends Object implements 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 Details

    • MeasureType

      public MeasureType()
      Default constructor for the MeasureType class.
    • MeasureType

      public MeasureType(BigDecimal value)
      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

      public static MeasureType parse(String value)
      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

      public String toString()
      Returns the string representation of the measure value, formatted to at least four decimal places.
      Overrides:
      toString in class Object
      Returns:
      the string representation of the measure value.