|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.validator.routines.checkdigit.VerhoeffCheckDigit
public final class VerhoeffCheckDigit
Verhoeff (Dihedral) Check Digit calculation/validation.
Check digit calculation for numeric codes using a Dihedral Group of order 10.
See Wikipedia - Verhoeff algorithm for more details.
| Field Summary | |
|---|---|
static CheckDigit |
VERHOEFF_CHECK_DIGIT
Singleton Verhoeff Check Digit instance |
| Constructor Summary | |
|---|---|
VerhoeffCheckDigit()
|
|
| Method Summary | |
|---|---|
String |
calculate(String code)
Calculate a Verhoeff Check Digit for a code. |
boolean |
isValid(String code)
Validate the Verhoeff Check Digit for a code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final CheckDigit VERHOEFF_CHECK_DIGIT
| Constructor Detail |
|---|
public VerhoeffCheckDigit()
| Method Detail |
|---|
public boolean isValid(String code)
isValid in interface CheckDigitcode - The code to validate
true if the check digit is valid,
otherwise false
public String calculate(String code)
throws CheckDigitException
calculate in interface CheckDigitcode - The code to calculate the Check Digit for
CheckDigitException - if an error occurs calculating
the check digit for the specified code
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||