19 package org.turro.elephant.context;
21 import java.util.ArrayList;
22 import java.util.Collection;
23 import java.util.Iterator;
24 import org.turro.util.CompareUtil;
30 public class MetaList extends ArrayList<String> {
32 public MetaList(Collection<? extends String> c) {
37 public boolean addAll(Collection<? extends String> c) {
38 if(c ==
null)
return false;
46 public boolean add(String e) {
47 Iterator<String> it = iterator();
49 String meta = it.next();
50 if(isSameProperty(meta, e)) {
57 private boolean isSameProperty(String meta1, String meta2) {
58 return CompareUtil.compare(metaProperty(meta1), metaProperty(meta2)) == 0;
61 private String metaProperty(String meta) {
62 int p = meta.indexOf(
"content=");
64 return meta.substring(0, p).toLowerCase().trim();
66 return meta.toLowerCase().trim();
MetaList(Collection<? extends String > c)
boolean addAll(Collection<? extends String > c)