|
16 | 16 | */ |
17 | 17 | package org.apache.commons.validator.routines.checkdigit; |
18 | 18 |
|
19 | | -/* |
20 | | -die 5 subklassen Benennungen (mit rekursiven/iterativen Implementierung) |
21 | | -
|
22 | | - IsoIecPure11System : MOD 11-2 : eine Ziffer oder 'X' |
23 | | - IsoIecPure37System : MOD 37-2 : ein alphanumerisches Zeichen oder '*' |
24 | | - IsoIecPure97System : MOD 97-10: zwei Ziffern ==> toCheckDigit() , toInt() muss man also überschreiben |
25 | | - IsoIecPure661System : MOD 661-26: zwei Buchstaben |
26 | | - IsoIecPure1271System : MOD 1271_36: zwei alphanumerische Zeichen |
27 | | -
|
28 | | -MOD 11-2 und MOD 37-2 Implementierungen berechnen die pz auch für {"", "0", "00", ... }, die Norm konform "1" ergibt. |
29 | | -Nicht aber für null! |
30 | | -MOD 97-10 und MOD 1271_36 berechnen für {"", "0", "00", ... } "01" als pz. |
31 | | -Auch in MOD 661-26 sind die zwei (int) pz 0 und 1, was als Buchstaben "AB" liefert. |
32 | | -
|
33 | | -IsoIec7064PurePolynomialSystem ist eine eigene abstrakte Klasse für die polynomiale Implementierung, |
34 | | -daraus sind dann die endglültigen Klassen abgeleitet |
35 | | -
|
36 | | -*/ |
| 19 | +/** |
| 20 | + * Abstract implementation for five check digit calculation/validation defined in the ISO/IEC 7064 standard. |
| 21 | + * <ul> |
| 22 | + * <li>ISO/IEC 7064, MOD 11-2 applies to numeric strings ({@link IsoIecPure11System})</li> |
| 23 | + * <li>ISO/IEC 7064, MOD 37-2 applies to alphanumeric strings ({@link IsoIecPure37System})</li> |
| 24 | + * <li>ISO/IEC 7064, MOD 97-10 applies to numeric strings ({@link IsoIecPure97System})</li> |
| 25 | + * <li>ISO/IEC 7064, MOD 661-26 applies to alphabetic strings ({@link IsoIecPure661System})</li> |
| 26 | + * <li>ISO/IEC 7064, MOD 1271_36 applies to alphanumeric strings ({@link IsoIecPure1271System})</li> |
| 27 | + * </ul> |
| 28 | + * <p> |
| 29 | + * <b>Pure</b> system algorithms use a single modulus value {@link #getModulus()} and a radix {@link #getRadix()}, |
| 30 | + * f.i. the modulus for MOD 11-2 is 11, the radix is 2. |
| 31 | + * There is also an alternative polynomial implementation for the pure systems, |
| 32 | + * see {@link IsoIec7064PurePolynomialSystem} and subclasses. |
| 33 | + * </p> |
| 34 | + * <p> |
| 35 | + * The standard also defines hybrid systems with two modulus values (see {@link IsoIec7064HybridSystem}). |
| 36 | + * </p> |
| 37 | + * |
| 38 | + * @author EUG https://github.com/homebeaver |
| 39 | + * @since 1.10.0 |
| 40 | + */ |
37 | 41 | public abstract class IsoIec7064PureSystem extends ModulusCheckDigit { |
38 | 42 |
|
39 | 43 | private static final long serialVersionUID = 8956070914814659350L; |
@@ -64,6 +68,10 @@ public abstract class IsoIec7064PureSystem extends ModulusCheckDigit { |
64 | 68 | this.checkdigitLength = checkdigitLength; |
65 | 69 | } |
66 | 70 |
|
| 71 | + /** |
| 72 | + * Returns the lentgth of the check digit for the system |
| 73 | + * @return checkdigitLength can be one ore two chars |
| 74 | + */ |
67 | 75 | public int getCheckdigitLength() { |
68 | 76 | return checkdigitLength; |
69 | 77 | } |
|
0 commit comments