commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1545289 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4: HuffmanTree.java T4AndT6Compression.java T4_T6_Tables.java
Date Mon, 25 Nov 2013 14:07:21 GMT
Author: ebourg
Date: Mon Nov 25 14:07:21 2013
New Revision: 1545289

URL: http://svn.apache.org/r1545289
Log:
Added a generic parameter to the HuffmanTree class

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/HuffmanTree.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4AndT6Compression.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4_T6_Tables.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/HuffmanTree.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/HuffmanTree.java?rev=1545289&r1=1545288&r2=1545289&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/HuffmanTree.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/HuffmanTree.java
Mon Nov 25 14:07:21 2013
@@ -25,16 +25,15 @@ import org.apache.commons.imaging.common
 /**
  * A Huffman tree implemented as 1 array for high locality of reference.
  */
-class HuffmanTree {
-    private final List<Node> nodes = new ArrayList<Node>();
+class HuffmanTree<T> {
+    private final List<Node<T>> nodes = new ArrayList<Node<T>>();
     
-    private final static class Node {
-        boolean isEmpty = true;
-        Object value = null;
+    private final static class Node<T> {
+        boolean empty = true;
+        T value;
     }
 
-    public final void insert(final String pattern, final Object value)
-            throws HuffmanTreeException {
+    public final void insert(final String pattern, final T value) throws HuffmanTreeException
{
         int position = 0;
         Node node = growAndGetNode(position);
         if (node.value != null) {
@@ -55,19 +54,18 @@ class HuffmanTree {
         node.value = value;
     }
 
-    private Node growAndGetNode(final int position) {
+    private Node<T> growAndGetNode(final int position) {
         while (position >= nodes.size()) {
-            nodes.add(new Node());
+            nodes.add(new Node<T>());
         }
-        final Node node = nodes.get(position);
-        node.isEmpty = false;
+        final Node<T> node = nodes.get(position);
+        node.empty = false;
         return node;
     }
 
-    public final Object decode(final BitInputStreamFlexible bitStream)
-            throws HuffmanTreeException {
+    public final T decode(final BitInputStreamFlexible bitStream) throws HuffmanTreeException
{
         int position = 0;
-        Node node = nodes.get(0);
+        Node<T> node = nodes.get(0);
         while (node.value == null) {
             int nextBit;
             try {
@@ -85,7 +83,7 @@ class HuffmanTree {
                 throw new HuffmanTreeException("Invalid bit pattern");
             }
             node = nodes.get(position);
-            if (node.isEmpty) {
+            if (node.empty) {
                 throw new HuffmanTreeException("Invalid bit pattern");
             }
         }

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4AndT6Compression.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4AndT6Compression.java?rev=1545289&r1=1545288&r2=1545289&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4AndT6Compression.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4AndT6Compression.java
Mon Nov 25 14:07:21 2013
@@ -28,9 +28,9 @@ import org.apache.commons.imaging.util.D
 import org.apache.commons.imaging.util.IoUtils;
 
 public final class T4AndT6Compression {
-    private static final HuffmanTree whiteRunLengths = new HuffmanTree();
-    private static final HuffmanTree blackRunLengths = new HuffmanTree();
-    private static final HuffmanTree controlCodes = new HuffmanTree();
+    private static final HuffmanTree<Integer> WHITE_RUN_LENGTHS = new HuffmanTree<Integer>();
+    private static final HuffmanTree<Integer> BLACK_RUN_LENGTHS = new HuffmanTree<Integer>();
+    private static final HuffmanTree<Entry> CONTROL_CODES = new HuffmanTree<Entry>();
 
     public static final int WHITE = 0;
     public static final int BLACK = 1;
@@ -38,45 +38,38 @@ public final class T4AndT6Compression {
     static {
         try {
             for (final Entry entry : T4_T6_Tables.WHITE_TERMINATING_CODES) {
-                whiteRunLengths.insert(entry.bitString, entry.value);
+                WHITE_RUN_LENGTHS.insert(entry.bitString, entry.value);
             }
             for (final Entry entry : T4_T6_Tables.WHITE_MAKE_UP_CODES) {
-                whiteRunLengths.insert(entry.bitString, entry.value);
+                WHITE_RUN_LENGTHS.insert(entry.bitString, entry.value);
             }
             for (final Entry entry : T4_T6_Tables.BLACK_TERMINATING_CODES) {
-                blackRunLengths.insert(entry.bitString, entry.value);
+                BLACK_RUN_LENGTHS.insert(entry.bitString, entry.value);
             }
             for (final Entry entry : T4_T6_Tables.BLACK_MAKE_UP_CODES) {
-                blackRunLengths.insert(entry.bitString, entry.value);
+                BLACK_RUN_LENGTHS.insert(entry.bitString, entry.value);
             }
             for (final Entry entry : T4_T6_Tables.ADDITIONAL_MAKE_UP_CODES) {
-                whiteRunLengths.insert(entry.bitString, entry.value);
-                blackRunLengths.insert(entry.bitString, entry.value);
+                WHITE_RUN_LENGTHS.insert(entry.bitString, entry.value);
+                BLACK_RUN_LENGTHS.insert(entry.bitString, entry.value);
             }
-            controlCodes.insert(T4_T6_Tables.EOL.bitString, T4_T6_Tables.EOL);
-            controlCodes.insert(T4_T6_Tables.EOL13.bitString,
-                    T4_T6_Tables.EOL13);
-            controlCodes.insert(T4_T6_Tables.EOL14.bitString,
-                    T4_T6_Tables.EOL14);
-            controlCodes.insert(T4_T6_Tables.EOL15.bitString,
-                    T4_T6_Tables.EOL15);
-            controlCodes.insert(T4_T6_Tables.EOL16.bitString,
-                    T4_T6_Tables.EOL16);
-            controlCodes.insert(T4_T6_Tables.EOL17.bitString,
-                    T4_T6_Tables.EOL17);
-            controlCodes.insert(T4_T6_Tables.EOL18.bitString,
-                    T4_T6_Tables.EOL18);
-            controlCodes.insert(T4_T6_Tables.EOL19.bitString,
-                    T4_T6_Tables.EOL19);
-            controlCodes.insert(T4_T6_Tables.P.bitString, T4_T6_Tables.P);
-            controlCodes.insert(T4_T6_Tables.H.bitString, T4_T6_Tables.H);
-            controlCodes.insert(T4_T6_Tables.V0.bitString, T4_T6_Tables.V0);
-            controlCodes.insert(T4_T6_Tables.VL1.bitString, T4_T6_Tables.VL1);
-            controlCodes.insert(T4_T6_Tables.VL2.bitString, T4_T6_Tables.VL2);
-            controlCodes.insert(T4_T6_Tables.VL3.bitString, T4_T6_Tables.VL3);
-            controlCodes.insert(T4_T6_Tables.VR1.bitString, T4_T6_Tables.VR1);
-            controlCodes.insert(T4_T6_Tables.VR2.bitString, T4_T6_Tables.VR2);
-            controlCodes.insert(T4_T6_Tables.VR3.bitString, T4_T6_Tables.VR3);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL.bitString, T4_T6_Tables.EOL);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL13.bitString, T4_T6_Tables.EOL13);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL14.bitString, T4_T6_Tables.EOL14);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL15.bitString, T4_T6_Tables.EOL15);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL16.bitString, T4_T6_Tables.EOL16);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL17.bitString, T4_T6_Tables.EOL17);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL18.bitString, T4_T6_Tables.EOL18);
+            CONTROL_CODES.insert(T4_T6_Tables.EOL19.bitString, T4_T6_Tables.EOL19);
+            CONTROL_CODES.insert(T4_T6_Tables.P.bitString, T4_T6_Tables.P);
+            CONTROL_CODES.insert(T4_T6_Tables.H.bitString, T4_T6_Tables.H);
+            CONTROL_CODES.insert(T4_T6_Tables.V0.bitString, T4_T6_Tables.V0);
+            CONTROL_CODES.insert(T4_T6_Tables.VL1.bitString, T4_T6_Tables.VL1);
+            CONTROL_CODES.insert(T4_T6_Tables.VL2.bitString, T4_T6_Tables.VL2);
+            CONTROL_CODES.insert(T4_T6_Tables.VL3.bitString, T4_T6_Tables.VL3);
+            CONTROL_CODES.insert(T4_T6_Tables.VR1.bitString, T4_T6_Tables.VR1);
+            CONTROL_CODES.insert(T4_T6_Tables.VR2.bitString, T4_T6_Tables.VR2);
+            CONTROL_CODES.insert(T4_T6_Tables.VR3.bitString, T4_T6_Tables.VR3);
         } catch (final HuffmanTreeException cannotHappen) {
             Debug.debug(cannotHappen);
         }
@@ -237,7 +230,7 @@ public final class T4AndT6Compression {
                 T4_T6_Tables.Entry entry;
                 int rowLength;
                 try {
-                    entry = (T4_T6_Tables.Entry) controlCodes.decode(inputStream);
+                    entry = CONTROL_CODES.decode(inputStream);
                     if (!isEOL(entry, hasFill)) {
                         throw new ImageReadException("Expected EOL not found");
                     }
@@ -251,15 +244,13 @@ public final class T4AndT6Compression {
                         rowLength += runLength;
                     }
                 } catch (final HuffmanTreeException huffmanException) {
-                    throw new ImageReadException("Decompression error",
-                            huffmanException);
+                    throw new ImageReadException("Decompression error", huffmanException);
                 }
     
                 if (rowLength == width) {
                     outputStream.flush();
                 } else if (rowLength > width) {
-                    throw new ImageReadException(
-                            "Unrecoverable row length error in image row " + y);
+                    throw new ImageReadException("Unrecoverable row length error in image
row " + y);
                 }
             }
             final byte[] ret = outputStream.toByteArray();
@@ -409,7 +400,7 @@ public final class T4AndT6Compression {
             T4_T6_Tables.Entry entry;
             int rowLength = 0;
             try {
-                entry = (T4_T6_Tables.Entry) controlCodes.decode(inputStream);
+                entry = CONTROL_CODES.decode(inputStream);
                 if (!isEOL(entry, hasFill)) {
                     throw new ImageReadException("Expected EOL not found");
                 }
@@ -424,8 +415,7 @@ public final class T4AndT6Compression {
                             1 - referenceA0Color, b1 + 1);
                     for (int a0 = 0; a0 < width;) {
                         int a1, a2;
-                        entry = (T4_T6_Tables.Entry) controlCodes
-                                .decode(inputStream);
+                        entry = CONTROL_CODES.decode(inputStream);
                         if (entry == T4_T6_Tables.P) {
                             fillRange(outputStream, referenceLine, a0, b2,
                                     codingA0Color);
@@ -637,8 +627,7 @@ public final class T4AndT6Compression {
                         1 - referenceA0Color, b1 + 1);
                 for (int a0 = 0; a0 < width;) {
                     int a1, a2;
-                    entry = (T4_T6_Tables.Entry) controlCodes
-                            .decode(inputStream);
+                    entry = CONTROL_CODES.decode(inputStream);
                     if (entry == T4_T6_Tables.P) {
                         fillRange(outputStream, referenceLine, a0, b2,
                                 codingA0Color);
@@ -777,16 +766,15 @@ public final class T4AndT6Compression {
             Integer runLength;
             do {
                 if (color == WHITE) {
-                    runLength = (Integer) whiteRunLengths.decode(bitStream);
+                    runLength = WHITE_RUN_LENGTHS.decode(bitStream);
                 } else {
-                    runLength = (Integer) blackRunLengths.decode(bitStream);
+                    runLength = BLACK_RUN_LENGTHS.decode(bitStream);
                 }
                 totalLength += runLength;
             } while (runLength > 63);
             return totalLength;
         } catch (final HuffmanTreeException huffmanException) {
-            throw new ImageReadException("Decompression error",
-                    huffmanException);
+            throw new ImageReadException("Decompression error", huffmanException);
         }
     }
 

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4_T6_Tables.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4_T6_Tables.java?rev=1545289&r1=1545288&r2=1545289&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4_T6_Tables.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/common/itu_t4/T4_T6_Tables.java
Mon Nov 25 14:07:21 2013
@@ -20,241 +20,233 @@ import org.apache.commons.imaging.common
 
 class T4_T6_Tables {
     public static final Entry[] WHITE_TERMINATING_CODES = {
-            new Entry("00110101", Integer.valueOf(0)),
-            new Entry("000111", Integer.valueOf(1)),
-            new Entry("0111", Integer.valueOf(2)),
-            new Entry("1000", Integer.valueOf(3)),
-            new Entry("1011", Integer.valueOf(4)),
-            new Entry("1100", Integer.valueOf(5)),
-            new Entry("1110", Integer.valueOf(6)),
-            new Entry("1111", Integer.valueOf(7)),
-            new Entry("10011", Integer.valueOf(8)),
-            new Entry("10100", Integer.valueOf(9)),
-            new Entry("00111", Integer.valueOf(10)),
-            new Entry("01000", Integer.valueOf(11)),
-            new Entry("001000", Integer.valueOf(12)),
-            new Entry("000011", Integer.valueOf(13)),
-            new Entry("110100", Integer.valueOf(14)),
-            new Entry("110101", Integer.valueOf(15)),
-            new Entry("101010", Integer.valueOf(16)),
-            new Entry("101011", Integer.valueOf(17)),
-            new Entry("0100111", Integer.valueOf(18)),
-            new Entry("0001100", Integer.valueOf(19)),
-            new Entry("0001000", Integer.valueOf(20)),
-            new Entry("0010111", Integer.valueOf(21)),
-            new Entry("0000011", Integer.valueOf(22)),
-            new Entry("0000100", Integer.valueOf(23)),
-            new Entry("0101000", Integer.valueOf(24)),
-            new Entry("0101011", Integer.valueOf(25)),
-            new Entry("0010011", Integer.valueOf(26)),
-            new Entry("0100100", Integer.valueOf(27)),
-            new Entry("0011000", Integer.valueOf(28)),
-            new Entry("00000010", Integer.valueOf(29)),
-            new Entry("00000011", Integer.valueOf(30)),
-            new Entry("00011010", Integer.valueOf(31)),
-            new Entry("00011011", Integer.valueOf(32)),
-            new Entry("00010010", Integer.valueOf(33)),
-            new Entry("00010011", Integer.valueOf(34)),
-            new Entry("00010100", Integer.valueOf(35)),
-            new Entry("00010101", Integer.valueOf(36)),
-            new Entry("00010110", Integer.valueOf(37)),
-            new Entry("00010111", Integer.valueOf(38)),
-            new Entry("00101000", Integer.valueOf(39)),
-            new Entry("00101001", Integer.valueOf(40)),
-            new Entry("00101010", Integer.valueOf(41)),
-            new Entry("00101011", Integer.valueOf(42)),
-            new Entry("00101100", Integer.valueOf(43)),
-            new Entry("00101101", Integer.valueOf(44)),
-            new Entry("00000100", Integer.valueOf(45)),
-            new Entry("00000101", Integer.valueOf(46)),
-            new Entry("00001010", Integer.valueOf(47)),
-            new Entry("00001011", Integer.valueOf(48)),
-            new Entry("01010010", Integer.valueOf(49)),
-            new Entry("01010011", Integer.valueOf(50)),
-            new Entry("01010100", Integer.valueOf(51)),
-            new Entry("01010101", Integer.valueOf(52)),
-            new Entry("00100100", Integer.valueOf(53)),
-            new Entry("00100101", Integer.valueOf(54)),
-            new Entry("01011000", Integer.valueOf(55)),
-            new Entry("01011001", Integer.valueOf(56)),
-            new Entry("01011010", Integer.valueOf(57)),
-            new Entry("01011011", Integer.valueOf(58)),
-            new Entry("01001010", Integer.valueOf(59)),
-            new Entry("01001011", Integer.valueOf(60)),
-            new Entry("00110010", Integer.valueOf(61)),
-            new Entry("00110011", Integer.valueOf(62)),
-            new Entry("00110100", Integer.valueOf(63)), };
+            new Entry("00110101", 0),
+            new Entry("000111", 1),
+            new Entry("0111", 2),
+            new Entry("1000", 3),
+            new Entry("1011", 4),
+            new Entry("1100", 5),
+            new Entry("1110", 6),
+            new Entry("1111", 7),
+            new Entry("10011", 8),
+            new Entry("10100", 9),
+            new Entry("00111", 10),
+            new Entry("01000", 11),
+            new Entry("001000", 12),
+            new Entry("000011", 13),
+            new Entry("110100", 14),
+            new Entry("110101", 15),
+            new Entry("101010", 16),
+            new Entry("101011", 17),
+            new Entry("0100111", 18),
+            new Entry("0001100", 19),
+            new Entry("0001000", 20),
+            new Entry("0010111", 21),
+            new Entry("0000011", 22),
+            new Entry("0000100", 23),
+            new Entry("0101000", 24),
+            new Entry("0101011", 25),
+            new Entry("0010011", 26),
+            new Entry("0100100", 27),
+            new Entry("0011000", 28),
+            new Entry("00000010", 29),
+            new Entry("00000011", 30),
+            new Entry("00011010", 31),
+            new Entry("00011011", 32),
+            new Entry("00010010", 33),
+            new Entry("00010011", 34),
+            new Entry("00010100", 35),
+            new Entry("00010101", 36),
+            new Entry("00010110", 37),
+            new Entry("00010111", 38),
+            new Entry("00101000", 39),
+            new Entry("00101001", 40),
+            new Entry("00101010", 41),
+            new Entry("00101011", 42),
+            new Entry("00101100", 43),
+            new Entry("00101101", 44),
+            new Entry("00000100", 45),
+            new Entry("00000101", 46),
+            new Entry("00001010", 47),
+            new Entry("00001011", 48),
+            new Entry("01010010", 49),
+            new Entry("01010011", 50),
+            new Entry("01010100", 51),
+            new Entry("01010101", 52),
+            new Entry("00100100", 53),
+            new Entry("00100101", 54),
+            new Entry("01011000", 55),
+            new Entry("01011001", 56),
+            new Entry("01011010", 57),
+            new Entry("01011011", 58),
+            new Entry("01001010", 59),
+            new Entry("01001011", 60),
+            new Entry("00110010", 61),
+            new Entry("00110011", 62),
+            new Entry("00110100", 63), };
 
     public static final Entry[] BLACK_TERMINATING_CODES = {
-            new Entry("0000110111", Integer.valueOf(0)),
-            new Entry("010", Integer.valueOf(1)),
-            new Entry("11", Integer.valueOf(2)),
-            new Entry("10", Integer.valueOf(3)),
-            new Entry("011", Integer.valueOf(4)),
-            new Entry("0011", Integer.valueOf(5)),
-            new Entry("0010", Integer.valueOf(6)),
-            new Entry("00011", Integer.valueOf(7)),
-            new Entry("000101", Integer.valueOf(8)),
-            new Entry("000100", Integer.valueOf(9)),
-            new Entry("0000100", Integer.valueOf(10)),
-            new Entry("0000101", Integer.valueOf(11)),
-            new Entry("0000111", Integer.valueOf(12)),
-            new Entry("00000100", Integer.valueOf(13)),
-            new Entry("00000111", Integer.valueOf(14)),
-            new Entry("000011000", Integer.valueOf(15)),
-            new Entry("0000010111", Integer.valueOf(16)),
-            new Entry("0000011000", Integer.valueOf(17)),
-            new Entry("0000001000", Integer.valueOf(18)),
-            new Entry("00001100111", Integer.valueOf(19)),
-            new Entry("00001101000", Integer.valueOf(20)),
-            new Entry("00001101100", Integer.valueOf(21)),
-            new Entry("00000110111", Integer.valueOf(22)),
-            new Entry("00000101000", Integer.valueOf(23)),
-            new Entry("00000010111", Integer.valueOf(24)),
-            new Entry("00000011000", Integer.valueOf(25)),
-            new Entry("000011001010", Integer.valueOf(26)),
-            new Entry("000011001011", Integer.valueOf(27)),
-            new Entry("000011001100", Integer.valueOf(28)),
-            new Entry("000011001101", Integer.valueOf(29)),
-            new Entry("000001101000", Integer.valueOf(30)),
-            new Entry("000001101001", Integer.valueOf(31)),
-            new Entry("000001101010", Integer.valueOf(32)),
-            new Entry("000001101011", Integer.valueOf(33)),
-            new Entry("000011010010", Integer.valueOf(34)),
-            new Entry("000011010011", Integer.valueOf(35)),
-            new Entry("000011010100", Integer.valueOf(36)),
-            new Entry("000011010101", Integer.valueOf(37)),
-            new Entry("000011010110", Integer.valueOf(38)),
-            new Entry("000011010111", Integer.valueOf(39)),
-            new Entry("000001101100", Integer.valueOf(40)),
-            new Entry("000001101101", Integer.valueOf(41)),
-            new Entry("000011011010", Integer.valueOf(42)),
-            new Entry("000011011011", Integer.valueOf(43)),
-            new Entry("000001010100", Integer.valueOf(44)),
-            new Entry("000001010101", Integer.valueOf(45)),
-            new Entry("000001010110", Integer.valueOf(46)),
-            new Entry("000001010111", Integer.valueOf(47)),
-            new Entry("000001100100", Integer.valueOf(48)),
-            new Entry("000001100101", Integer.valueOf(49)),
-            new Entry("000001010010", Integer.valueOf(50)),
-            new Entry("000001010011", Integer.valueOf(51)),
-            new Entry("000000100100", Integer.valueOf(52)),
-            new Entry("000000110111", Integer.valueOf(53)),
-            new Entry("000000111000", Integer.valueOf(54)),
-            new Entry("000000100111", Integer.valueOf(55)),
-            new Entry("000000101000", Integer.valueOf(56)),
-            new Entry("000001011000", Integer.valueOf(57)),
-            new Entry("000001011001", Integer.valueOf(58)),
-            new Entry("000000101011", Integer.valueOf(59)),
-            new Entry("000000101100", Integer.valueOf(60)),
-            new Entry("000001011010", Integer.valueOf(61)),
-            new Entry("000001100110", Integer.valueOf(62)),
-            new Entry("000001100111", Integer.valueOf(63)), };
+            new Entry("0000110111", 0),
+            new Entry("010", 1),
+            new Entry("11", 2),
+            new Entry("10", 3),
+            new Entry("011", 4),
+            new Entry("0011", 5),
+            new Entry("0010", 6),
+            new Entry("00011", 7),
+            new Entry("000101", 8),
+            new Entry("000100", 9),
+            new Entry("0000100", 10),
+            new Entry("0000101", 11),
+            new Entry("0000111", 12),
+            new Entry("00000100", 13),
+            new Entry("00000111", 14),
+            new Entry("000011000", 15),
+            new Entry("0000010111", 16),
+            new Entry("0000011000", 17),
+            new Entry("0000001000", 18),
+            new Entry("00001100111", 19),
+            new Entry("00001101000", 20),
+            new Entry("00001101100", 21),
+            new Entry("00000110111", 22),
+            new Entry("00000101000", 23),
+            new Entry("00000010111", 24),
+            new Entry("00000011000", 25),
+            new Entry("000011001010", 26),
+            new Entry("000011001011", 27),
+            new Entry("000011001100", 28),
+            new Entry("000011001101", 29),
+            new Entry("000001101000", 30),
+            new Entry("000001101001", 31),
+            new Entry("000001101010", 32),
+            new Entry("000001101011", 33),
+            new Entry("000011010010", 34),
+            new Entry("000011010011", 35),
+            new Entry("000011010100", 36),
+            new Entry("000011010101", 37),
+            new Entry("000011010110", 38),
+            new Entry("000011010111", 39),
+            new Entry("000001101100", 40),
+            new Entry("000001101101", 41),
+            new Entry("000011011010", 42),
+            new Entry("000011011011", 43),
+            new Entry("000001010100", 44),
+            new Entry("000001010101", 45),
+            new Entry("000001010110", 46),
+            new Entry("000001010111", 47),
+            new Entry("000001100100", 48),
+            new Entry("000001100101", 49),
+            new Entry("000001010010", 50),
+            new Entry("000001010011", 51),
+            new Entry("000000100100", 52),
+            new Entry("000000110111", 53),
+            new Entry("000000111000", 54),
+            new Entry("000000100111", 55),
+            new Entry("000000101000", 56),
+            new Entry("000001011000", 57),
+            new Entry("000001011001", 58),
+            new Entry("000000101011", 59),
+            new Entry("000000101100", 60),
+            new Entry("000001011010", 61),
+            new Entry("000001100110", 62),
+            new Entry("000001100111", 63), };
 
     public static final Entry[] WHITE_MAKE_UP_CODES = {
-            new Entry("11011", Integer.valueOf(64)),
-            new Entry("10010", Integer.valueOf(128)),
-            new Entry("010111", Integer.valueOf(192)),
-            new Entry("0110111", Integer.valueOf(256)),
-            new Entry("00110110", Integer.valueOf(320)),
-            new Entry("00110111", Integer.valueOf(384)),
-            new Entry("01100100", Integer.valueOf(448)),
-            new Entry("01100101", Integer.valueOf(512)),
-            new Entry("01101000", Integer.valueOf(576)),
-            new Entry("01100111", Integer.valueOf(640)),
-            new Entry("011001100", Integer.valueOf(704)),
-            new Entry("011001101", Integer.valueOf(768)),
-            new Entry("011010010", Integer.valueOf(832)),
-            new Entry("011010011", Integer.valueOf(896)),
-            new Entry("011010100", Integer.valueOf(960)),
-            new Entry("011010101", Integer.valueOf(1024)),
-            new Entry("011010110", Integer.valueOf(1088)),
-            new Entry("011010111", Integer.valueOf(1152)),
-            new Entry("011011000", Integer.valueOf(1216)),
-            new Entry("011011001", Integer.valueOf(1280)),
-            new Entry("011011010", Integer.valueOf(1344)),
-            new Entry("011011011", Integer.valueOf(1408)),
-            new Entry("010011000", Integer.valueOf(1472)),
-            new Entry("010011001", Integer.valueOf(1536)),
-            new Entry("010011010", Integer.valueOf(1600)),
-            new Entry("011000", Integer.valueOf(1664)),
-            new Entry("010011011", Integer.valueOf(1728)), };
+            new Entry("11011", 64),
+            new Entry("10010", 128),
+            new Entry("010111", 192),
+            new Entry("0110111", 256),
+            new Entry("00110110", 320),
+            new Entry("00110111", 384),
+            new Entry("01100100", 448),
+            new Entry("01100101", 512),
+            new Entry("01101000", 576),
+            new Entry("01100111", 640),
+            new Entry("011001100", 704),
+            new Entry("011001101", 768),
+            new Entry("011010010", 832),
+            new Entry("011010011", 896),
+            new Entry("011010100", 960),
+            new Entry("011010101", 1024),
+            new Entry("011010110", 1088),
+            new Entry("011010111", 1152),
+            new Entry("011011000", 1216),
+            new Entry("011011001", 1280),
+            new Entry("011011010", 1344),
+            new Entry("011011011", 1408),
+            new Entry("010011000", 1472),
+            new Entry("010011001", 1536),
+            new Entry("010011010", 1600),
+            new Entry("011000", 1664),
+            new Entry("010011011", 1728), };
 
     public static final Entry[] BLACK_MAKE_UP_CODES = {
-            new Entry("0000001111", Integer.valueOf(64)),
-            new Entry("000011001000", Integer.valueOf(128)),
-            new Entry("000011001001", Integer.valueOf(192)),
-            new Entry("000001011011", Integer.valueOf(256)),
-            new Entry("000000110011", Integer.valueOf(320)),
-            new Entry("000000110100", Integer.valueOf(384)),
-            new Entry("000000110101", Integer.valueOf(448)),
-            new Entry("0000001101100", Integer.valueOf(512)),
-            new Entry("0000001101101", Integer.valueOf(576)),
-            new Entry("0000001001010", Integer.valueOf(640)),
-            new Entry("0000001001011", Integer.valueOf(704)),
-            new Entry("0000001001100", Integer.valueOf(768)),
-            new Entry("0000001001101", Integer.valueOf(832)),
-            new Entry("0000001110010", Integer.valueOf(896)),
-            new Entry("0000001110011", Integer.valueOf(960)),
-            new Entry("0000001110100", Integer.valueOf(1024)),
-            new Entry("0000001110101", Integer.valueOf(1088)),
-            new Entry("0000001110110", Integer.valueOf(1152)),
-            new Entry("0000001110111", Integer.valueOf(1216)),
-            new Entry("0000001010010", Integer.valueOf(1280)),
-            new Entry("0000001010011", Integer.valueOf(1344)),
-            new Entry("0000001010100", Integer.valueOf(1408)),
-            new Entry("0000001010101", Integer.valueOf(1472)),
-            new Entry("0000001011010", Integer.valueOf(1536)),
-            new Entry("0000001011011", Integer.valueOf(1600)),
-            new Entry("0000001100100", Integer.valueOf(1664)),
-            new Entry("0000001100101", Integer.valueOf(1728)), };
+            new Entry("0000001111", 64),
+            new Entry("000011001000", 128),
+            new Entry("000011001001", 192),
+            new Entry("000001011011", 256),
+            new Entry("000000110011", 320),
+            new Entry("000000110100", 384),
+            new Entry("000000110101", 448),
+            new Entry("0000001101100", 512),
+            new Entry("0000001101101", 576),
+            new Entry("0000001001010", 640),
+            new Entry("0000001001011", 704),
+            new Entry("0000001001100", 768),
+            new Entry("0000001001101", 832),
+            new Entry("0000001110010", 896),
+            new Entry("0000001110011", 960),
+            new Entry("0000001110100", 1024),
+            new Entry("0000001110101", 1088),
+            new Entry("0000001110110", 1152),
+            new Entry("0000001110111", 1216),
+            new Entry("0000001010010", 1280),
+            new Entry("0000001010011", 1344),
+            new Entry("0000001010100", 1408),
+            new Entry("0000001010101", 1472),
+            new Entry("0000001011010", 1536),
+            new Entry("0000001011011", 1600),
+            new Entry("0000001100100", 1664),
+            new Entry("0000001100101", 1728), };
 
     public static final Entry[] ADDITIONAL_MAKE_UP_CODES = {
-            new Entry("00000001000", Integer.valueOf(1792)),
-            new Entry("00000001100", Integer.valueOf(1856)),
-            new Entry("00000001101", Integer.valueOf(1920)),
-            new Entry("000000010010", Integer.valueOf(1984)),
-            new Entry("000000010011", Integer.valueOf(2048)),
-            new Entry("000000010100", Integer.valueOf(2112)),
-            new Entry("000000010101", Integer.valueOf(2176)),
-            new Entry("000000010110", Integer.valueOf(2240)),
-            new Entry("000000010111", Integer.valueOf(2304)),
-            new Entry("000000011100", Integer.valueOf(2368)),
-            new Entry("000000011101", Integer.valueOf(2432)),
-            new Entry("000000011110", Integer.valueOf(2496)),
-            new Entry("000000011111", Integer.valueOf(2560)), };
-
-    public static final Entry EOL = new Entry("000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL13 = new Entry("0000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL14 = new Entry("00000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL15 = new Entry("000000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL16 = new Entry("0000000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL17 = new Entry("00000000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL18 = new Entry("000000000000000001",
-            Integer.valueOf(0));
-    public static final Entry EOL19 = new Entry("0000000000000000001",
-            Integer.valueOf(0));
-    public static final Entry P = new Entry("0001", Integer.valueOf(0));
-    public static final Entry H = new Entry("001", Integer.valueOf(0));
-    public static final Entry V0 = new Entry("1", Integer.valueOf(0));
-    public static final Entry VR1 = new Entry("011", Integer.valueOf(0));
-    public static final Entry VR2 = new Entry("000011", Integer.valueOf(0));
-    public static final Entry VR3 = new Entry("0000011", Integer.valueOf(0));
-    public static final Entry VL1 = new Entry("010", Integer.valueOf(0));
-    public static final Entry VL2 = new Entry("000010", Integer.valueOf(0));
-    public static final Entry VL3 = new Entry("0000010", Integer.valueOf(0));
+            new Entry("00000001000", 1792),
+            new Entry("00000001100", 1856),
+            new Entry("00000001101", 1920),
+            new Entry("000000010010", 1984),
+            new Entry("000000010011", 2048),
+            new Entry("000000010100", 2112),
+            new Entry("000000010101", 2176),
+            new Entry("000000010110", 2240),
+            new Entry("000000010111", 2304),
+            new Entry("000000011100", 2368),
+            new Entry("000000011101", 2432),
+            new Entry("000000011110", 2496),
+            new Entry("000000011111", 2560), };
+
+    public static final Entry EOL = new Entry("000000000001", 0);
+    public static final Entry EOL13 = new Entry("0000000000001", 0);
+    public static final Entry EOL14 = new Entry("00000000000001", 0);
+    public static final Entry EOL15 = new Entry("000000000000001", 0);
+    public static final Entry EOL16 = new Entry("0000000000000001", 0);
+    public static final Entry EOL17 = new Entry("00000000000000001", 0);
+    public static final Entry EOL18 = new Entry("000000000000000001", 0);
+    public static final Entry EOL19 = new Entry("0000000000000000001", 0);
+    public static final Entry P = new Entry("0001", 0);
+    public static final Entry H = new Entry("001", 0);
+    public static final Entry V0 = new Entry("1", 0);
+    public static final Entry VR1 = new Entry("011", 0);
+    public static final Entry VR2 = new Entry("000011", 0);
+    public static final Entry VR3 = new Entry("0000011", 0);
+    public static final Entry VL1 = new Entry("010", 0);
+    public static final Entry VL2 = new Entry("000010", 0);
+    public static final Entry VL3 = new Entry("0000010", 0);
     
     public static class Entry {
         String bitString;
         Integer value;
 
-        public Entry(final String bitString, final Integer value) {
+        public Entry(final String bitString, final int value) {
             this.bitString = bitString;
             this.value = value;
         }



Mime
View raw message