1 package com.icl.saxon.om; 2 3 6 7 public class SingletonEnumeration implements AxisEnumeration { 8 9 private NodeInfo theNode; 10 private boolean gone; 11 private int count; 12 13 public SingletonEnumeration(NodeInfo node) { 14 theNode = node; 15 gone = (node==null); 16 count = (node==null ? 0 : 1); 17 } 18 19 public boolean hasMoreElements() { 20 return !gone; 21 } 22 23 public NodeInfo nextElement() { 24 gone = true; 25 return theNode; 26 } 27 28 public boolean isSorted() { 29 return true; 30 } 31 32 public boolean isReverseSorted() { 33 return true; 34 } 35 36 public boolean isPeer() { 37 return true; 38 } 39 40 public int getLastPosition() { 41 return count; 42 } 43 } 44 45 | Popular Tags |