public class Modulo10 extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
getMod10CheckDigit(String data,
int weightOdd)
Calculates a modulo 10 check digit based on the passed numeric data.
|
static int |
getMod10CheckDigit(String data,
int weightEven,
int weightOdd)
Calculates a modulo 10 check digit based on the passed numeric data.
|
static int |
getMod10CheckDigit(String data,
int weightEven,
int weightOdd,
boolean beginsEven)
Calculates a modulo 10 check digit based on the passed numeric data.
|
public static int getMod10CheckDigit(String data, int weightEven, int weightOdd, boolean beginsEven) throws NumberFormatException
data - The data to encode into a Modulo 10 check digitweightEven - Every even digit will be multiplied by this valueweightOdd - Every odd digit will be multiplied by this valuebeginsEven - true if the first numeric data is to be treated as even,
false if the first digit is to be treated as oddNumberFormatExceptiongetMod10CheckDigit(String, int, int),
getMod10CheckDigit(String, int)public static int getMod10CheckDigit(String data, int weightEven, int weightOdd) throws NumberFormatException
data - The data to encode into a Modulo 10 check digitweightEven - Every even digit will be multiplied by this valueweightOdd - Every odd digit will be multiplied by this value
false if the first digit is to be treated as oddNumberFormatExceptiongetMod10CheckDigit(String, int)public static int getMod10CheckDigit(String data, int weightOdd) throws NumberFormatException
data - The data to encode into a Modulo 10 check digitweightOdd - Every odd digit will be multiplied by this valueNumberFormatExceptiongetMod10CheckDigit(String, int, int)Copyright © 2003-2013 barbecue.sourceforge.net. All Rights Reserved.