1 16 19 20 package com.sun.org.apache.xalan.internal.xsltc.dom; 21 22 import com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary; 23 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; 24 import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase; 25 import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase; 26 27 40 public final class AbsoluteIterator extends DTMAxisIteratorBase { 41 42 45 private DTMAxisIterator _source; 46 47 public AbsoluteIterator(DTMAxisIterator source) { 48 _source = source; 49 } 51 52 public void setRestartable(boolean isRestartable) { 53 _isRestartable = isRestartable; 54 _source.setRestartable(isRestartable); 55 } 56 57 public DTMAxisIterator setStartNode(int node) { 58 _startNode = DTMDefaultBase.ROOTNODE; 59 if (_isRestartable) { 60 _source.setStartNode(_startNode); 61 resetPosition(); 62 } 63 return this; 64 } 65 66 public int next() { 67 return returnNode(_source.next()); 68 } 69 70 public DTMAxisIterator cloneIterator() { 71 try { 72 final AbsoluteIterator clone = (AbsoluteIterator) super.clone(); 73 clone._source = _source.cloneIterator(); clone.resetPosition(); 75 clone._isRestartable = false; 76 return clone; 77 } 78 catch (CloneNotSupportedException e) { 79 BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, 80 e.toString()); 81 return null; 82 } 83 } 84 85 public DTMAxisIterator reset() { 86 _source.reset(); 87 return resetPosition(); 88 } 89 90 public void setMark() { 91 _source.setMark(); 92 } 93 94 public void gotoMark() { 95 _source.gotoMark(); 96 } 97 } 98 | Popular Tags |