1 package net.sf.saxon.tinytree; 2 import net.sf.saxon.om.NamePool; 3 4 import java.util.Iterator ; 5 6 9 10 final class DeclaredPrefixIterator implements Iterator { 11 12 private TinyTree tree; 13 private NamePool pool; 14 private int owner; 15 private int index; 16 17 18 public DeclaredPrefixIterator(TinyElementImpl node) { 19 owner = node.nodeNr; 20 tree = node.tree; 21 pool = tree.getNamePool(); 22 index = tree.beta[owner]; } 24 25 32 33 public boolean hasNext() { 34 return index >= 0 && tree.namespaceParent[index] == owner; 35 } 36 37 46 47 public Object next() { 48 int nscode = tree.namespaceCode[index--]; 49 return pool.getPrefix(nscode>>16); 50 } 51 52 53 67 public void remove() { 68 throw new UnsupportedOperationException (); 69 } 70 } 71 72 73 74 | Popular Tags |