commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1220990 [2/2] - in /commons/proper/sanselan/trunk/src: main/java/org/apache/commons/sanselan/ main/java/org/apache/commons/sanselan/common/ main/java/org/apache/commons/sanselan/common/itu_t4/ main/java/org/apache/commons/sanselan/formats/...
Date Mon, 19 Dec 2011 23:01:48 GMT
Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java?rev=1220990&r1=1220989&r2=1220990&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java
Mon Dec 19 23:01:46 2011
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.sanselan.ImageWriteException;
@@ -70,10 +71,10 @@ public class MedianCutQuantizer
     {
         //        public final ColorGroup parent;
         public ColorGroupCut cut = null;
-        //        public final ArrayList children = new ArrayList();
+        //        public final List children = new ArrayList();
         public int palette_index = -1;
 
-        public final ArrayList color_counts;
+        public final List color_counts;
         public int min_red = Integer.MAX_VALUE;
         public int max_red = Integer.MIN_VALUE;
         public int min_green = Integer.MAX_VALUE;
@@ -91,8 +92,7 @@ public class MedianCutQuantizer
         public final int max_diff;
         public final int diff_total;
 
-        public ColorGroup(final ArrayList color_counts)
-                throws ImageWriteException
+        public ColorGroup(final List color_counts) throws ImageWriteException
         {
             this.color_counts = color_counts;
 
@@ -251,7 +251,7 @@ public class MedianCutQuantizer
                 Debug.debug("lossless palette: " + discrete_colors);
 
             int palette[] = new int[discrete_colors];
-            ArrayList color_counts = new ArrayList(color_map.values());
+            List color_counts = new ArrayList(color_map.values());
 
             for (int i = 0; i < color_counts.size(); i++)
             {
@@ -267,7 +267,7 @@ public class MedianCutQuantizer
         if (verbose)
             Debug.debug("discrete colors: " + discrete_colors);
 
-        ArrayList color_groups = new ArrayList();
+        List color_groups = new ArrayList();
         ColorGroup root = new ColorGroup(new ArrayList(color_map.values()));
         {
             color_groups.add(root);
@@ -354,7 +354,7 @@ public class MedianCutQuantizer
     private static final int BLUE = 3;
 
     private void doCut(ColorGroup color_group, final int mode,
-            final ArrayList color_groups) throws ImageWriteException
+            final List color_groups) throws ImageWriteException
     {
         int count_total = 0;
         for (int i = 0; i < color_group.color_counts.size(); i++)
@@ -418,9 +418,9 @@ public class MedianCutQuantizer
 
         color_groups.remove(color_group);
         {
-            ArrayList color_counts1 = new ArrayList(color_group.color_counts
+            List color_counts1 = new ArrayList(color_group.color_counts
                     .subList(0, median_index + 1));
-            ArrayList color_counts2 = new ArrayList(color_group.color_counts
+            List color_counts2 = new ArrayList(color_group.color_counts
                     .subList(median_index + 1, color_group.color_counts.size()));
 
             ColorGroup less, more;

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/PaletteFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/PaletteFactory.java?rev=1220990&r1=1220989&r2=1220990&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/PaletteFactory.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/PaletteFactory.java
Mon Dec 19 23:01:46 2011
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 public class PaletteFactory
@@ -169,7 +170,7 @@ public class PaletteFactory
             return null;
         }
 
-        //        ArrayList result = new ArrayList();
+        //        List result = new ArrayList();
 
         int slice_mins[] = new int[subset.mins.length];
         System.arraycopy(subset.mins, 0, slice_mins, 0, subset.mins.length);
@@ -199,7 +200,7 @@ public class PaletteFactory
 
     }
 
-    private ArrayList divideSubset2(int table[], ColorSpaceSubset subset,
+    private List divideSubset2(int table[], ColorSpaceSubset subset,
             int component, int precision)
     {
         if (debug)
@@ -242,7 +243,7 @@ public class PaletteFactory
         DivisionCandidate dc2 = finishDivision(table, subset, component,
                 precision, sum2, slice2);
 
-        ArrayList result = new ArrayList();
+        List result = new ArrayList();
 
         if (dc1 != null)
             result.add(dc1);
@@ -255,7 +256,7 @@ public class PaletteFactory
     private DivisionCandidate divideSubset2(int table[],
             ColorSpaceSubset subset, int precision)
     {
-        ArrayList dcs = new ArrayList();
+        List dcs = new ArrayList();
 
         dcs.addAll(divideSubset2(table, subset, 0, precision));
         dcs.addAll(divideSubset2(table, subset, 1, precision));
@@ -311,10 +312,10 @@ public class PaletteFactory
         }
     }
 
-    private ArrayList divide(ArrayList v, int desired_count, int table[],
+    private List divide(List v, int desired_count, int table[],
             int precision)
     {
-        ArrayList ignore = new ArrayList();
+        List ignore = new ArrayList();
 
         int count = 0;
         while (true)
@@ -386,7 +387,7 @@ public class PaletteFactory
         int width = src.getWidth();
         int height = src.getHeight();
 
-        ArrayList subsets = new ArrayList();
+        List subsets = new ArrayList();
         ColorSpaceSubset all = new ColorSpaceSubset(width * height, precision);
         subsets.add(all);
 

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/QuantizedPalette.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/QuantizedPalette.java?rev=1220990&r1=1220989&r2=1220990&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/QuantizedPalette.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/QuantizedPalette.java
Mon Dec 19 23:01:46 2011
@@ -16,17 +16,17 @@
  */
 package org.apache.commons.sanselan.palette;
 
-import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.commons.sanselan.ImageWriteException;
 
 public class QuantizedPalette extends Palette
 {
     private final int precision;
-    private final ArrayList subsets;
+    private final List subsets;
     private final ColorSpaceSubset straight[];
 
-    public QuantizedPalette(ArrayList subsets, int precision)
+    public QuantizedPalette(List subsets, int precision)
     {
         this.subsets = subsets;
         this.precision = precision;

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/util/Debug.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/util/Debug.java?rev=1220990&r1=1220989&r2=1220990&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/util/Debug.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/util/Debug.java
Mon Dec 19 23:01:46 2011
@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 
 public final class Debug
@@ -185,7 +186,7 @@ public final class Debug
         if (map == null)
             return getDebug(message + " map: " + null);
 
-        ArrayList keys = new ArrayList(map.keySet());
+        List keys = new ArrayList(map.keySet());
         result.append(getDebug(message + " map: " + keys.size()) + newline);
         for (int i = 0; i < keys.size(); i++)
         {
@@ -217,7 +218,7 @@ public final class Debug
     }
 
     public static boolean compare(String prefix, Map a, Map b,
-            ArrayList ignore, StringBuffer buffer)
+            List ignore, StringBuffer buffer)
     {
         if ((a == null) && (b == null))
         {
@@ -235,8 +236,8 @@ public final class Debug
             return false;
         }
 
-        ArrayList keys_a = new ArrayList(a.keySet());
-        ArrayList keys_b = new ArrayList(b.keySet());
+        List keys_a = new ArrayList(a.keySet());
+        List keys_b = new ArrayList(b.keySet());
 
         if (ignore != null)
         {
@@ -886,7 +887,7 @@ public final class Debug
         {
             java.util.Map map = (java.util.Map) value;
             debug(prefix, "map");
-            ArrayList keys = new ArrayList(map.keySet());
+            List keys = new ArrayList(map.keySet());
             Collections.sort(keys);
             for (int i = 0; i < keys.size(); i++)
             {

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java?rev=1220990&r1=1220989&r2=1220990&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/examples/MetadataExample.java
Mon Dec 19 23:01:46 2011
@@ -19,6 +19,7 @@ package org.apache.commons.sanselan.exam
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.commons.sanselan.ImageReadException;
 import org.apache.commons.sanselan.Sanselan;
@@ -139,7 +140,7 @@ public class MetadataExample
 
             System.out.println();
 
-            ArrayList items = jpegMetadata.getItems();
+            List items = jpegMetadata.getItems();
             for (int i = 0; i < items.size(); i++)
             {
                 Object item = items.get(i);

Modified: commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java?rev=1220990&r1=1220989&r2=1220990&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java
(original)
+++ commons/proper/sanselan/trunk/src/test/java/org/apache/commons/sanselan/formats/jpeg/exif/ExifRewriteTest.java
Mon Dec 19 23:01:46 2011
@@ -294,7 +294,7 @@ public class ExifRewriteTest extends Exi
         rewrite(rewriter, "lossless");
     }
 
-    private Hashtable makeDirectoryMap(ArrayList directories)
+    private Hashtable makeDirectoryMap(List directories)
     {
         Hashtable directoryMap = new Hashtable();
         for (int i = 0; i < directories.size(); i++)
@@ -306,7 +306,7 @@ public class ExifRewriteTest extends Exi
         return directoryMap;
     }
 
-    private Hashtable makeFieldMap(ArrayList items)
+    private Hashtable makeFieldMap(List items)
     {
         Hashtable fieldMap = new Hashtable();
         for (int i = 0; i < items.size(); i++)
@@ -326,8 +326,8 @@ public class ExifRewriteTest extends Exi
         assertNotNull(oldExifMetadata);
         assertNotNull(newExifMetadata);
 
-        ArrayList oldDirectories = oldExifMetadata.getDirectories();
-        ArrayList newDirectories = newExifMetadata.getDirectories();
+        List oldDirectories = oldExifMetadata.getDirectories();
+        List newDirectories = newExifMetadata.getDirectories();
 
         assertTrue(oldDirectories.size() == newDirectories.size());
 
@@ -335,9 +335,9 @@ public class ExifRewriteTest extends Exi
         Hashtable newDirectoryMap = makeDirectoryMap(newDirectories);
 
         assertEquals(oldDirectories.size(), oldDirectoryMap.keySet().size());
-        ArrayList oldDirectoryTypes = new ArrayList(oldDirectoryMap.keySet());
+        List oldDirectoryTypes = new ArrayList(oldDirectoryMap.keySet());
         Collections.sort(oldDirectoryTypes);
-        ArrayList newDirectoryTypes = new ArrayList(newDirectoryMap.keySet());
+        List newDirectoryTypes = new ArrayList(newDirectoryMap.keySet());
         Collections.sort(newDirectoryTypes);
         assertEquals(oldDirectoryTypes, newDirectoryTypes);
 
@@ -354,8 +354,8 @@ public class ExifRewriteTest extends Exi
             assertNotNull(oldDirectory);
             assertNotNull(newDirectory);
 
-            ArrayList oldItems = oldDirectory.getItems();
-            ArrayList newItems = newDirectory.getItems();
+            List oldItems = oldDirectory.getItems();
+            List newItems = newDirectory.getItems();
 
             //            Debug.debug("oldItems.size()", oldItems.size());
             //            Debug.debug("newItems.size()", newItems.size());
@@ -394,9 +394,9 @@ public class ExifRewriteTest extends Exi
             //            assertEquals(oldFieldMap.keySet(), newFieldMap.keySet());
             //            assertEquals(oldFieldMap.keySet(), newFieldMap.keySet());
 
-            ArrayList oldFieldTags = new ArrayList(oldFieldMap.keySet());
+            List oldFieldTags = new ArrayList(oldFieldMap.keySet());
             Collections.sort(oldFieldTags);
-            ArrayList newFieldTags = new ArrayList(newFieldMap.keySet());
+            List newFieldTags = new ArrayList(newFieldMap.keySet());
             Collections.sort(newFieldTags);
             assertEquals(oldFieldTags, newFieldTags);
 



Mime
View raw message