APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.dom

public abstract Class MultiValuedNodeHeapIterator

extends DTMAxisIteratorBase
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.dom.UnionIterator, com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex.KeyIndexIterator
Imports
com.sun.org.apache.xalan.internal.xsltc.DOM, com.sun.org.apache.xalan.internal.xsltc.runtime.BasisLibrary, com.sun.org.apache.xml.internal.dtm.DTMAxisIterator, com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase

MultiValuedNodeHeapIterator takes a set of multi-valued heap nodes and produces a merged NodeSet in document order with duplicates removed.

Each multi-valued heap node (which might be a org.apache.xml.dtm.DTMAxisIterator, but that's not necessary) generates DTM node handles in document order. The class maintains the multi-valued heap nodes in a heap, not surprisingly, sorted by the next DTM node handle available form the heap node.

After a DTM node is pulled from the heap node that's at the top of the heap, the heap node is advanced to the next DTM node handle it makes available, and the heap nature of the heap is restored to ensure the next DTM node handle pulled is next in document order overall.

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract class
MultiValuedNodeHeapIterator.HeapNode

An abstract representation of a set of nodes that will be retrieved in document order.

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private MultiValuedNodeHeapIterator.HeapNode[]
private int
private int
private int
private static final int
Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase:
_includeSelf_isRestartable_last_markedNode_position_startNode

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public DTMAxisIterator
public void
gotoMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Restores the current node remembered by setMark().

private void
heapify(int i)

protected void
init()

public int
next()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Get the next node in the iteration.

public DTMAxisIterator
public void
setMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Remembers the current node for the next call to gotoMark().

public DTMAxisIterator
setStartNode(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

Inherited from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase:
getAxisgetLastgetNodeByPositiongetPositiongetStartNodeincludeSelfisDocOrderedisReverseresetPositionreturnNodesetRestartable

Field Detail

_cachedHeapSizeback to summary
private int _cachedHeapSize
_cachedReturnedLastback to summary
private int _cachedReturnedLast
_freeback to summary
private int _free
_heapback to summary
private MultiValuedNodeHeapIterator.HeapNode[] _heap
_heapSizeback to summary
private int _heapSize
_returnedLastback to summary
private int _returnedLast
_sizeback to summary
private int _size
InitSizeback to summary
private static final int InitSize

Constructor Detail

MultiValuedNodeHeapIteratorback to summary
public MultiValuedNodeHeapIterator()

Method Detail

addHeapNodeback to summary
protected void addHeapNode(MultiValuedNodeHeapIterator.HeapNode node)
cloneIteratorback to summary
public DTMAxisIterator cloneIterator()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.cloneIterator.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.cloneIterator.

Doc from com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.cloneIterator.

Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation.

gotoMarkback to summary
public void gotoMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.gotoMark.

Restores the current node remembered by setMark().

heapifyback to summary
private void heapify(int i)
initback to summary
protected void init()
nextback to summary
public int next()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.next.

Get the next node in the iteration.

resetback to summary
public DTMAxisIterator reset()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase.reset.

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.reset.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.reset.

Resets the iterator to the last start node.

setMarkback to summary
public void setMark()

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setMark.

Remembers the current node for the next call to gotoMark().

setStartNodeback to summary
public DTMAxisIterator setStartNode(int node)

Implements com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Doc from com.sun.org.apache.xml.internal.dtm.DTMAxisIterator.setStartNode.

Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.

com.sun.org.apache.xalan.internal.xsltc.dom back to summary

public abstract Class MultiValuedNodeHeapIterator.HeapNode

extends Object
implements Cloneable
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xalan.internal.xsltc.dom.MultiValuedNodeHeapIterator.HeapNode
All Implemented Interfaces
java.lang.Cloneable
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.dom.UnionIterator.LookAheadIterator, com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex.KeyIndexIterator.KeyIndexHeapNode

An abstract representation of a set of nodes that will be retrieved in document order.

Field Summary

Modifier and TypeField and Description
protected boolean
protected int
protected int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public MultiValuedNodeHeapIterator.HeapNode

Returns:

the cloned heap node
cloneHeapNode
()

Creates a deep copy of this HeapNode.

public void
gotoMark()

Restores the current node remembered by setMark().

public abstract boolean

Returns:

true if and only if the current node for this heap node is before the current node of the argument heap node in document order.
isLessThan
(MultiValuedNodeHeapIterator.HeapNode
the heap node against which to compare
heapNode
)

Performs a comparison of the two heap nodes

public abstract MultiValuedNodeHeapIterator.HeapNode

Returns:

a HeapNode which may or may not be the same as this HeapNode.
reset
()

Reset the heap node back to its beginning.

public void
setMark()

Remembers the current node for the next call to gotoMark().

public abstract MultiValuedNodeHeapIterator.HeapNode

Returns:

a HeapNode which may or may not be the same as this HeapNode.
setStartNode
(int
The new context node
node
)

Sets context with respect to which this heap node is evaluated.

public abstract int

Returns:

the next DTM node.
step
()

Advance to the next node represented by this HeapNode

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_isStartSetback to summary
protected boolean _isStartSet
_markedNodeback to summary
protected int _markedNode
_nodeback to summary
protected int _node

Constructor Detail

HeapNodeback to summary
public HeapNode()

Method Detail

cloneHeapNodeback to summary
public MultiValuedNodeHeapIterator.HeapNode cloneHeapNode()

Creates a deep copy of this HeapNode. The clone is not reset from the current position of the original.

Returns:MultiValuedNodeHeapIterator.HeapNode

the cloned heap node

gotoMarkback to summary
public void gotoMark()

Restores the current node remembered by setMark().

isLessThanback to summary
public abstract boolean isLessThan(MultiValuedNodeHeapIterator.HeapNode heapNode)

Performs a comparison of the two heap nodes

Parameters
heapNode:MultiValuedNodeHeapIterator.HeapNode

the heap node against which to compare

Returns:boolean

true if and only if the current node for this heap node is before the current node of the argument heap node in document order.

resetback to summary
public abstract MultiValuedNodeHeapIterator.HeapNode reset()

Reset the heap node back to its beginning.

Returns:MultiValuedNodeHeapIterator.HeapNode

a HeapNode which may or may not be the same as this HeapNode.

setMarkback to summary
public void setMark()

Remembers the current node for the next call to gotoMark().

setStartNodeback to summary
public abstract MultiValuedNodeHeapIterator.HeapNode setStartNode(int node)

Sets context with respect to which this heap node is evaluated.

Parameters
node:int

The new context node

Returns:MultiValuedNodeHeapIterator.HeapNode

a HeapNode which may or may not be the same as this HeapNode.

stepback to summary
public abstract int step()

Advance to the next node represented by this HeapNode

Returns:int

the next DTM node.