/**\r
* Patterns of Wide / Narrow lines to indicate each digit\r
*/\r
- static final int[][] PATTERNS = {\r
+ private static final int[][] PATTERNS = {\r
{N, N, W, W, N}, // 0\r
{W, N, N, N, W}, // 1\r
{N, W, N, N, W}, // 2\r
{N, W, N, W, N} // 9\r
};\r
\r
- public final Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException {\r
+ public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException {\r
\r
StringBuffer result = new StringBuffer(20);\r
\r
* @param resultString {@link StringBuffer} to append decoded chars to\r
* @throws ReaderException if decoding could not complete successfully\r
*/\r
- protected void decodeMiddle(BitArray row, int payloadStart, int payloadEnd, StringBuffer resultString) throws ReaderException {\r
+ static void decodeMiddle(BitArray row, int payloadStart, int payloadEnd, StringBuffer resultString) throws ReaderException {\r
\r
// Digits are interleaved in pairs - 5 black lines for one digit, and the\r
// 5\r
}\r
\r
int bestMatch = decodeDigit(counterBlack);\r
- resultString.append((char) ('0' + bestMatch % 10));\r
+ resultString.append((char) ('0' + bestMatch));\r
bestMatch = decodeDigit(counterWhite);\r
- resultString.append((char) ('0' + bestMatch % 10));\r
+ resultString.append((char) ('0' + bestMatch));\r
\r
for (int i = 0; i < counterDigitPair.length; i++) {\r
payloadStart += counterDigitPair[i];\r
*/\r
int[] decodeStart(BitArray row) throws ReaderException {\r
int endStart = skipWhiteSpace(row);\r
- int startPattern[] = findGuardPattern(row, endStart, START_PATTERN);\r
+ int[] startPattern = findGuardPattern(row, endStart, START_PATTERN);\r
\r
// Determine the width of a narrow line in pixels. We can do this by\r
// getting the width of the start pattern and dividing by 4 because its\r
row.reverse();\r
\r
int endStart = skipWhiteSpace(row);\r
- int endPattern[];\r
+ int[] endPattern;\r
try {\r
endPattern = findGuardPattern(row, endStart, END_PATTERN_REVERSED);\r
} catch (ReaderException e) {\r
* @return The decoded digit\r
* @throws ReaderException if digit cannot be decoded\r
*/\r
- static int decodeDigit(int[] counters) throws ReaderException {\r
+ private static int decodeDigit(int[] counters) throws ReaderException {\r
\r
int bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept\r
int bestMatch = -1;\r