org.apache.xalan.transformer
Class CountersTable

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable
          extended by org.apache.xalan.transformer.CountersTable
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class CountersTable
extends java.util.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

Field Summary
(package private)  int m_countersMade
          Number of counters created so far
private  NodeSetDTM m_newFound
          Place to collect new counters.
(package private) static long serialVersionUID
           
 
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)  java.util.Vector getCounters(ElemNumber numberElem)
          Get the list of counters that corresponds to the given ElemNumber object.
(package private)  java.util.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

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

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

java.util.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

java.util.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