Class IsoIecPolynomial97System
java.lang.Object
org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
org.apache.commons.validator.routines.checkdigit.IsoIec7064PureSystem
org.apache.commons.validator.routines.checkdigit.IsoIec7064PurePolynomialSystem
org.apache.commons.validator.routines.checkdigit.IsoIecPolynomial97System
- All Implemented Interfaces:
Serializable,CheckDigit,IsoIecConstants
public class IsoIecPolynomial97System
extends IsoIec7064PurePolynomialSystem
implements IsoIecConstants
Implements ISO/IEC 7064, MOD 97-10 polynomial check digit calculation/validation.
MOD 97-10 applies to anumeric strings, the check digit is numeric. See Wikipedia - ISO/IEC_7064 (de) for more details.
- Since:
- 1.10.0
- Author:
- EUG https://github.com/homebeaver
- See Also:
-
Field Summary
Fields inherited from interface org.apache.commons.validator.routines.checkdigit.IsoIecConstants
ALPHABETIC, ALPHANUMERIC, ALPHANUMERIC_PLUS_STAR, MODULUS_1271, MODULUS_37, MODULUS_661, MODULUS_97, NUMERIC, NUMERIC_PLUS_X, RADIX_10, RADIX_2, RADIX_26, RADIX_36 -
Method Summary
Modifier and TypeMethodDescriptionprotected StringMOD 11-2 check characters are “0” to “9” plus “X” for example.static CheckDigitGets the singleton instance of this validator.protected intgetRadix()Radix is the second number following “MOD” in the ISO/IEC designation, f.i. 2 for "MOD 11-2"protected int[]Gets precomputed weights.Methods inherited from class org.apache.commons.validator.routines.checkdigit.IsoIec7064PurePolynomialSystem
calculate, calculateModulus, weightedValueMethods inherited from class org.apache.commons.validator.routines.checkdigit.IsoIec7064PureSystem
getCheckdigitLength, isValid, toCheckDigit, toIntMethods inherited from class org.apache.commons.validator.routines.checkdigit.ModulusCheckDigit
getModulus, sumDigits
-
Method Details
-
getInstance
Gets the singleton instance of this validator.- Returns:
- A singleton instance of the class.
-
getRadix
protected int getRadix()Description copied from class:IsoIec7064PureSystemRadix is the second number following “MOD” in the ISO/IEC designation, f.i. 2 for "MOD 11-2"- Specified by:
getRadixin classIsoIec7064PureSystem- Returns:
- the radix of the Check Digit routine
-
getWeightings
protected int[] getWeightings()Description copied from class:IsoIec7064PurePolynomialSystemGets precomputed weights. Override this in subclasses.- Overrides:
getWeightingsin classIsoIec7064PurePolynomialSystem- Returns:
- precalculated weights defined for the first positions.
-
getCharacterSet
Description copied from class:IsoIec7064PureSystemMOD 11-2 check characters are “0” to “9” plus “X” for example.- Specified by:
getCharacterSetin classIsoIec7064PureSystem- Returns:
- a String containing characters the check digit is build from.
This can be
IsoIecConstants.NUMERIC,IsoIecConstants.ALPHABETIC,IsoIecConstants.ALPHANUMERIC,IsoIecConstants.NUMERIC_PLUS_X,IsoIecConstants.ALPHANUMERIC_PLUS_STAR
-