OSDN Git Service

GNU Classpath import (libgcj-snapshot-20100921).
[pf3gnuchains/gcc-fork.git] / libjava / classpath / gnu / javax / swing / text / html / css / Selector.java
index 6e182a5..06d515c 100644 (file)
@@ -38,6 +38,9 @@ exception statement from your version. */
 
 package gnu.javax.swing.text.html.css;
 
+import gnu.java.lang.CPStringBuilder;
+
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
@@ -97,7 +100,7 @@ public class Selector
    * @return <code>true</code> when this selector matches the element path,
    *         <code>false</code> otherwise
    */
-  public boolean matches(String[] tags, Map[] attributes)
+  public boolean matches(String[] tags, List<Map<String,String>> attributes)
   {
     // TODO: This implements class, id and descendent matching. These are
     // the most commonly used selector matchers in CSS together with HTML.
@@ -118,11 +121,11 @@ public class Selector
             boolean tagMatch = false;
             for (; tagIndex < numTags && tagMatch == false; tagIndex++)
               {
-                Object pathClass = attributes[tagIndex].get("class");
+                Object pathClass = attributes.get(tagIndex).get("class");
                 // Try pseudo class too.
-                Object pseudoClass = attributes[tagIndex].get("_pseudo");
-                Object dynClass = attributes[tagIndex].get("_dynamic");
-                Object pathId = attributes[tagIndex].get("id");
+                Object pseudoClass = attributes.get(tagIndex).get("_pseudo");
+                Object dynClass = attributes.get(tagIndex).get("_dynamic");
+                Object pathId = attributes.get(tagIndex).get("id");
                 String tag = elements[j];
                 String clazz = classes[j];
                 String id = ids[j];
@@ -167,7 +170,7 @@ public class Selector
    */
   public String toString()
   {
-    StringBuilder b = new StringBuilder();
+    CPStringBuilder b = new CPStringBuilder();
     for (int i = selector.length - 1; i >= 0; i--)
       {
         b.append(selector[i]);