package gnu.javax.swing.text.html.css;
+import gnu.java.lang.CPStringBuilder;
+
+import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
* @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.
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];
*/
public String toString()
{
- StringBuilder b = new StringBuilder();
+ CPStringBuilder b = new CPStringBuilder();
for (int i = selector.length - 1; i >= 0; i--)
{
b.append(selector[i]);