|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xalan.transformer.NodeSorter
public class NodeSorter
This class can sort vectors of DOM nodes according to a select pattern.
Nested Class Summary | |
---|---|
(package private) class |
NodeSorter.NodeCompareElem
This class holds the value(s) from executing the given node against the sort key(s). |
Field Summary | |
---|---|
(package private) XPathContext |
m_execContext
Current XPath context |
(package private) java.util.Vector |
m_keys
Vector of NodeSortKeys |
Constructor Summary | |
---|---|
NodeSorter(XPathContext p)
Construct a NodeSorter, passing in the XSL TransformerFactory so it can know how to get the node data according to the proper whitespace rules. |
Method Summary | |
---|---|
(package private) int |
compare(NodeSorter.NodeCompareElem n1,
NodeSorter.NodeCompareElem n2,
int kIndex,
XPathContext support)
Return the results of a compare of two nodes. |
(package private) void |
mergesort(java.util.Vector a,
java.util.Vector b,
int l,
int r,
XPathContext support)
This implements a standard Mergesort, as described in Robert Sedgewick's Algorithms book. |
void |
sort(DTMIterator v,
java.util.Vector keys,
XPathContext support)
Given a vector of nodes, sort each node according to the criteria in the keys. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
XPathContext m_execContext
java.util.Vector m_keys
Constructor Detail |
---|
public NodeSorter(XPathContext p)
p
- Xpath context to useMethod Detail |
---|
public void sort(DTMIterator v, java.util.Vector keys, XPathContext support) throws javax.xml.transform.TransformerException
v
- an vector of Nodes.keys
- a vector of NodeSortKeys.support
- XPath context to use
javax.xml.transform.TransformerException
int compare(NodeSorter.NodeCompareElem n1, NodeSorter.NodeCompareElem n2, int kIndex, XPathContext support) throws javax.xml.transform.TransformerException
n1
- First node to use in comparen2
- Second node to use in comparekIndex
- Index of NodeSortKey to use for sortsupport
- XPath context to use
javax.xml.transform.TransformerException
void mergesort(java.util.Vector a, java.util.Vector b, int l, int r, XPathContext support) throws javax.xml.transform.TransformerException
a
- First vector of nodes to compareb
- Second vector of nodes to comparel
- Left boundary of partitionr
- Right boundary of partitionsupport
- XPath context to use
javax.xml.transform.TransformerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |