|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Basic method definitions for a check digit algorithm. The last digit of a supplied sequence of digits is verified using the provided check() method. If the algorithm uses weights the optional weights argument is used, otherwise it is set to null.
Method Summary | |
boolean |
check(int[] sequence,
int[] weights)
Checks if the supplied sequence matches the algorithm. |
int |
getCheckDigitPosition(int sequence)
Return the check digit position inside the sequence or -1 if no check digit is taken from the sequence. |
java.lang.String |
getName()
Get the name of the implemented check digit algorithm. |
java.lang.String |
getSymbol()
Get the symbol of the implemented check digit algorithm. |
boolean |
usesWeights()
Checks if the algorithm uses weights for the check digit calculation. |
Method Detail |
public boolean check(int[] sequence, int[] weights)
sequence
- Integer sequence representing the digits to check,
not necessary between 0 and 9.weights
- Weight sequence that can be of any length. If the
algorithm doesn't uses weights, null should be
supplied.public boolean usesWeights()
public java.lang.String getName()
public java.lang.String getSymbol()
public int getCheckDigitPosition(int sequence)
sequence
- Length of integer sequence representing the digits to
check, not necessary between 0 and 9.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |