1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.w3c.dom.DOMStringList ; 27 import java.util.*; 28 29 public class DOMStringListImpl implements DOMStringList { 30 private final List sourceList; 31 32 public DOMStringListImpl(Collection sourceList) { 33 List list = new ArrayList(); 34 list.addAll(sourceList); 35 this.sourceList = list; 36 } 37 38 public String item(int index) { 39 try { 40 return (String ) this.sourceList.get(index); 41 } catch(IndexOutOfBoundsException iob) { 42 return null; 43 } 44 } 45 46 public int getLength() { 47 return this.sourceList.size(); 48 } 49 50 public boolean contains(String str) { 51 return this.sourceList.contains(str); 52 } 53 } 54 | Popular Tags |