Package org.orekit.files.iirv.terms
Class CheckSumTerm
java.lang.Object
org.orekit.files.iirv.terms.base.IIRVVectorTerm<Long>
org.orekit.files.iirv.terms.base.LongValuedIIRVTerm
org.orekit.files.iirv.terms.CheckSumTerm
- All Implemented Interfaces:
Comparable<IIRVVectorTerm<?>>
Three-character checksum to validate message.
Calculated by summing the decimal equivalent of the preceding characters in the line, counting spaces as 0 and negative signs as 1:
- 0 through 9 = face value
- Minus (-) = 1
- ASCII Space = 0
Valid Values: 000-999
- Since:
- 13.0
- Author:
- Nick LaFarge
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe length of the IIRV term within the message.static final StringRegular expression that ensures the validity of string values for this term. -
Constructor Summary
ConstructorsConstructorDescriptionCheckSumTerm(long value) Constructor.CheckSumTerm(String value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeChecksum(String input) Computes the sum of the decimal equivalent of characters in the line, counting spaces as 0 and negative signs as 1.static CheckSumTermfromIIRVTerms(IIRVVectorTerm<?>... terms) Constructs an IIRV checksum from a series of IIRVTerm instances.booleanValidate the checksum from a line based on the object's checksum integer value.static booleanvalidateLineCheckSum(String line) Validate a line's embedded checksum value.Methods inherited from class org.orekit.files.iirv.terms.base.LongValuedIIRVTerm
computeValueFromString, toEncodedString, toInt, validateNumericValueMethods inherited from class org.orekit.files.iirv.terms.base.IIRVVectorTerm
compareTo, equals, hashCode, length, toEncodedString, validateString, value
-
Field Details
-
CHECK_SUM_TERM_LENGTH
public static final int CHECK_SUM_TERM_LENGTHThe length of the IIRV term within the message.- See Also:
-
CHECK_SUM_TERM_PATTERN
Regular expression that ensures the validity of string values for this term.- See Also:
-
-
Constructor Details
-
CheckSumTerm
Constructor.- Parameters:
value- value of the coordinate system term
-
CheckSumTerm
public CheckSumTerm(long value) Constructor.- Parameters:
value- value of the coordinate system term
-
-
Method Details
-
fromIIRVTerms
Constructs an IIRV checksum from a series of IIRVTerm instances.- Parameters:
terms- IIRVTerms to compute checksum- Returns:
- newly created CheckSum instance
-
computeChecksum
Computes the sum of the decimal equivalent of characters in the line, counting spaces as 0 and negative signs as 1.- Parameters:
input- input string to compute checksum from- Returns:
- computed checksum integer value
-
validateLineCheckSum
Validate a line's embedded checksum value.- Parameters:
line- string line of an IIRV message (including checksum as the final three characters)- Returns:
- true if the derived and embedded checksum values are equal
-
validateAgainstLineString
Validate the checksum from a line based on the object's checksum integer value.- Parameters:
line- string line of an IIRV message (including checksum as the final three characters)- Returns:
- true if the extracted checksum value matches this object's integer value
-