1 package com.icl.saxon.tree; 2 import com.icl.saxon.om.NodeInfo; 3 import com.icl.saxon.om.AxisEnumeration; 4 import com.icl.saxon.expr.LastPositionFinder; 5 6 7 13 14 15 final class ArrayEnumeration implements AxisEnumeration { 16 17 NodeInfo[] nodes; 18 int index = 0; 19 20 public ArrayEnumeration(NodeInfo[] nodes) { 21 this.nodes = nodes; 22 index = 0; 23 for (int i=0; i<nodes.length; i++) { 24 if (nodes[i]==null) { 25 System.err.println(" node " + i + " is null"); 26 } 27 } 28 } 29 30 public boolean hasMoreElements() { 31 return index < nodes.length; 32 } 33 34 public NodeInfo nextElement() { 35 return nodes[index++]; 36 } 37 38 public boolean isSorted() { 39 return true; 40 } 41 42 public boolean isReverseSorted() { 43 return false; 44 } 45 46 public boolean isPeer() { 47 return true; 48 } 49 50 public int getLastPosition() { 51 return nodes.length; 52 } 53 } 54 55 56 | Popular Tags |