Class LongValuedIIRVTerm

    • Constructor Detail

      • LongValuedIIRVTerm

        public LongValuedIIRVTerm​(String pattern,
                                  long value,
                                  int length,
                                  boolean isSigned)
        Constructs an IIRV Vector Term represented by a long. This representation is used for any numeric terms in the IIRV Vector that do not contain a decimal point.
        Parameters:
        pattern - Regular expression pattern that validates the term
        value - Value of the term, expressed as a long
        length - LengthC of the term, measured in number of characters in the String representation
        isSigned - True if negative values are permitted, false if the value is positive
      • LongValuedIIRVTerm

        public LongValuedIIRVTerm​(String pattern,
                                  String value,
                                  int length,
                                  boolean isSigned)
        Constructs an IIRV Vector Term represented by a Long. This representation is used for any numeric terms in the IIRV Vector that do not contain a decimal point.
        Parameters:
        pattern - Regular expression pattern that validates the term
        value - Value of the term, expressed as a String
        length - Length of the term, measured in number of characters in the String representation
        isSigned - True if negative values are permitted, false if the value is positive
    • Method Detail

      • computeValueFromString

        public static long computeValueFromString​(String value)
        Parses a string as a long, removing any leading spaces.
        Parameters:
        value - String value of the term.
        Returns:
        the long represented by the argument
      • toEncodedString

        public String toEncodedString​(Long termValue)
        Convert an IIRV term value into the encoded String representation, as it would appear in the IIRV message.
        Specified by:
        toEncodedString in class IIRVVectorTerm<Long>
        Parameters:
        termValue - Value of the term
        Returns:
        Encoded String representing of the inputted IIRV term it appears in the IIRV message
      • toInt

        public int toInt()
        Convert the underlying IIRVVectorTerm.value() from long to int.
        Returns:
        The value of the term as an int
      • validateNumericValue

        protected void validateNumericValue​(long value)
        Validate a given numerical value to ensure it is not greater than the maximum possible accuracy of this term, and that it does not contain a negative value for a positive term (when isSigned is false).
        Parameters:
        value - long value of this term