org.apache.xalan.xsltc.dom
Class NodeSortRecord

java.lang.Object
  extended by org.apache.xalan.xsltc.dom.NodeSortRecord

public abstract class NodeSortRecord
extends java.lang.Object

Base class for sort records containing application specific sort keys


Field Summary
protected  java.text.Collator _collator
          Deprecated. This field continues to exist for binary compatibility. New code should not refer to it.
protected  CollatorFactory _collatorFactory
           
protected  java.text.Collator[] _collators
           
private  DOM _dom
           
private  int _last
           
protected  java.util.Locale _locale
          Deprecated. This field continues to exist for binary compatibility. New code should not refer to it.
private  int _node
           
private  int _scanned
           
protected  SortSettings _settings
           
private  java.lang.Object[] _values
           
static int COMPARE_ASCENDING
           
static int COMPARE_DESCENDING
           
static int COMPARE_NUMERIC
           
static int COMPARE_STRING
           
private static java.text.Collator DEFAULT_COLLATOR
          Deprecated. This field continues to exist for binary compatibility. New code should not refer to it.
 
Constructor Summary
NodeSortRecord()
           
NodeSortRecord(int node)
          This constructor is run by a call to ClassLoader in the makeNodeSortRecord method in the NodeSortRecordFactory class.
 
Method Summary
 int compareDocOrder(NodeSortRecord other)
           
 int compareTo(NodeSortRecord other)
          Compare this sort element to another.
abstract  java.lang.String extractValueFromDOM(DOM dom, int current, int level, AbstractTranslet translet, int last)
          Extract the sort value for a level of this key.
 java.text.Collator[] getCollator()
          Returns the array of Collators used for text comparisons in this object.
 int getNode()
          Returns the node for this sort object
 void initialize(int node, int last, DOM dom, SortSettings settings)
          This method allows the caller to set the values that could not be passed to the default constructor.
private  java.lang.Double numericValue(int level)
           
private  java.lang.Comparable stringValue(int level)
          Get the string or numeric value of a specific level key for this sort element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARE_STRING

public static final int COMPARE_STRING
See Also:
Constant Field Values

COMPARE_NUMERIC

public static final int COMPARE_NUMERIC
See Also:
Constant Field Values

COMPARE_ASCENDING

public static final int COMPARE_ASCENDING
See Also:
Constant Field Values

COMPARE_DESCENDING

public static final int COMPARE_DESCENDING
See Also:
Constant Field Values

DEFAULT_COLLATOR

private static final java.text.Collator DEFAULT_COLLATOR
Deprecated. This field continues to exist for binary compatibility. New code should not refer to it.
A reference to a collator. May be updated by subclass if the stylesheet specifies a different language (will be updated iff _locale is updated).


_collator

protected java.text.Collator _collator
Deprecated. This field continues to exist for binary compatibility. New code should not refer to it.
A reference to the first Collator


_collators

protected java.text.Collator[] _collators

_locale

protected java.util.Locale _locale
Deprecated. This field continues to exist for binary compatibility. New code should not refer to it.
A locale field that might be set by an instance of a subclass.


_collatorFactory

protected CollatorFactory _collatorFactory

_settings

protected SortSettings _settings

_dom

private DOM _dom

_node

private int _node

_last

private int _last

_scanned

private int _scanned

_values

private java.lang.Object[] _values
Constructor Detail

NodeSortRecord

public NodeSortRecord(int node)
This constructor is run by a call to ClassLoader in the makeNodeSortRecord method in the NodeSortRecordFactory class. Since we cannot pass any parameters to the constructor in that case we just set the default values here and wait for new values through initialize().


NodeSortRecord

public NodeSortRecord()
Method Detail

initialize

public final void initialize(int node,
                             int last,
                             DOM dom,
                             SortSettings settings)
                      throws TransletException
This method allows the caller to set the values that could not be passed to the default constructor.

Throws:
TransletException

getNode

public final int getNode()
Returns the node for this sort object


compareDocOrder

public final int compareDocOrder(NodeSortRecord other)

stringValue

private final java.lang.Comparable stringValue(int level)
Get the string or numeric value of a specific level key for this sort element. The value is extracted from the DOM if it is not already in our sort key vector.


numericValue

private final java.lang.Double numericValue(int level)

compareTo

public int compareTo(NodeSortRecord other)
Compare this sort element to another. The first level is checked first, and we proceed to the next level only if the first level keys are identical (and so the key values may not even be extracted from the DOM) !!!!MUST OPTIMISE - THIS IS REALLY, REALLY SLOW!!!!


getCollator

public java.text.Collator[] getCollator()
Returns the array of Collators used for text comparisons in this object. May be overridden by inheriting classes


extractValueFromDOM

public abstract java.lang.String extractValueFromDOM(DOM dom,
                                                     int current,
                                                     int level,
                                                     AbstractTranslet translet,
                                                     int last)
Extract the sort value for a level of this key.