org.apache.xalan.transformer
Class CountersTable

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.apache.xalan.transformer.CountersTable
All Implemented Interfaces:
Cloneable, Map, Serializable

public class CountersTable
extends Hashtable

This is a table of counters, keyed by ElemNumber objects, each of which has a list of Counter objects. This really isn't a true table, it is more like a list of lists (there must be a technical term for that...).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
(package private)  int m_countersMade
          Number of counters created so far
private  NodeSetDTM m_newFound
          Place to collect new counters.
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
CountersTable()
          Construct a CountersTable.
 
Method Summary
(package private)  void appendBtoFList(NodeSetDTM flist, NodeSetDTM blist)
          Add a list of counted nodes that were built in backwards document order, or a list of counted nodes that are in forwards document order.
 int countNode(XPathContext support, ElemNumber numberElem, int node)
          Count forward until the given node is found, or until we have looked to the given amount.
(package private)  Vector getCounters(ElemNumber numberElem)
          Get the list of counters that corresponds to the given ElemNumber object.
(package private)  Vector putElemNumber(ElemNumber numberElem)
          Put a counter into the table and create an empty vector as it's value.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_newFound

private transient NodeSetDTM m_newFound
Place to collect new counters.


m_countersMade

transient int m_countersMade
Number of counters created so far

Constructor Detail

CountersTable

public CountersTable()
Construct a CountersTable.

Method Detail

getCounters

Vector getCounters(ElemNumber numberElem)
Get the list of counters that corresponds to the given ElemNumber object.

Parameters:
numberElem - the given xsl:number element.
Returns:
the list of counters that corresponds to the given ElemNumber object.

putElemNumber

Vector putElemNumber(ElemNumber numberElem)
Put a counter into the table and create an empty vector as it's value.

Parameters:
numberElem - the given xsl:number element.
Returns:
an empty vector to be used to store counts for this number element.

appendBtoFList

void appendBtoFList(NodeSetDTM flist,
                    NodeSetDTM blist)
Add a list of counted nodes that were built in backwards document order, or a list of counted nodes that are in forwards document order.

Parameters:
flist - Vector of nodes built in forwards document order
blist - Vector of nodes built in backwards document order

countNode

public int countNode(XPathContext support,
                     ElemNumber numberElem,
                     int node)
              throws javax.xml.transform.TransformerException
Count forward until the given node is found, or until we have looked to the given amount.

Parameters:
support - The XPath context to use
numberElem - The given xsl:number element.
node - The node to count.
Returns:
The node count, or 0 if not found.
Throws:
javax.xml.transform.TransformerException