1 30 31 package com.caucho.eswrap.org.w3c.dom; 32 33 import org.w3c.dom.NamedNodeMap ; 34 35 import java.util.Iterator ; 36 37 public class NamedNodeMapEcmaWrap { 38 static class NamedNodeMapIterator implements Iterator { 39 NamedNodeMap list; 40 int index; 41 42 public boolean hasNext() 43 { 44 return index < list.getLength(); 45 } 46 47 public Object next() 48 { 49 return index < list.getLength() ? list.item(index++) : null; 50 } 51 52 public void remove() 53 { 54 throw new UnsupportedOperationException (); 55 } 56 57 NamedNodeMapIterator(NamedNodeMap list) 58 { 59 this.list = list; 60 this.index = 0; 61 } 62 } 63 64 public static Iterator keys(NamedNodeMap NamedNodeMap) 65 { 66 return new NamedNodeMapIterator(NamedNodeMap); 67 } 68 } 69 70 | Popular Tags |