The number of nodes in the list. The range of valid child node indices
is 0 to <code>length-1</code> inclusive.

@return The number of nodes in the list, always greater or equal to zero.
175077
public int getLength()
  {
    if(!isReverseAxes())
      return super.getLength();
      
    // Tell if this is being called from within a predicate.
    boolean isPredicateTest = (this == m_execContext.getSubContextList());

    // And get how many total predicates are part of this step.
    int predCount = getPredicateCount();
   
    // If we have already calculated the length, and the current predicate 
    // is the first predicate, then return the length.  We don't cache 
    // the anything but the length of the list to the first predicate.
    if (-1 != m_length && isPredicateTest && m_predicateIndex < 1)
       return m_length;      

    int count = 0;
    
    XPathContext xctxt = getXPathContext();
    try
    {
      OneStepIterator clone = (OneStepIterator) this.cloneWithReset();
      
      int root = getRoot();
      xctxt.pushCurrentNode(root);
      clone.setRoot(root, xctxt);
 
      clone.m_predCount = m_predicateIndex;

      int next;

      while (DTM.NULL != (next = clone.nextNode()))
      {
        count++;
      }
    }
    catch (CloneNotSupportedException cnse)
    {
       // can't happen
    }
    finally
    {
      xctxt.popCurrentNode();
    }
    if (isPredicateTest && m_predicateIndex < 1)
      m_length = count;    
      
    return count;
  }
1368239
public int getLength() {
        int count=0;
        for (int handle=m_firstChild;
             handle!=DTM.NULL;
             handle=m_parentDTM.getNextSibling(handle)) {
            ++count;
        }
        return count;
    }
625477
public boolean isSelfLabel() {
        Set<Node> nodes = getNodes();
        return nodes.size() == 1 && nodes.iterator().next().getSelfLabel() == this;
    }
818965
public Node getCurrentNode()
  {

    if (!m_cacheNodes)
      throw new RuntimeException(
        XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!");

    int saved = m_next;
    Node n = (m_next < m_firstFree) ? elementAt(m_next) : null;
    m_next = saved; // HACK: I think this is a bit of a hack.  -sb
    return n;
  }
741051
public ArrayList<Pair<String, Integer>> nodes() {
        string_int_pair_vector v = ti.nodes();
        int size = (int) v.size();

        ArrayList<Pair<String, Integer>> l = new ArrayList<>(size);

        for (int i = 0; i < size; i++) {
            string_int_pair p = v.get(i);
            l.add(new Pair<>(p.getFirst(), p.getSecond()));
        }

        return l;
    }
862088
@Override
  public int count() {

    int listSize = getList().size();
    int pageSize = getPageSize();
    int pageCount = listSize / pageSize;

    pageCount += listSize % pageSize > 0 ? 1 : 0;

    return pageCount;
  }
50528
public int length() {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "length");
        if (tc.isDebugEnabled())
            SibTr.debug(tc, "rc=", elements);
        if (tc.isEntryEnabled())
            SibTr.exit(tc, "length");

        return elements;
    }
860430
public Node nextSibling() {
        if (parentNode == null)
            return null; // root

        final List<Node> siblings = parentNode.ensureChildNodes();
        final int index = siblingIndex+1;
        if (siblings.size() > index)
            return siblings.get(index);
        else
            return null;
    }
383312
public int getNodeCount(String strKey)
    {
        int iCount = 0;
        Node node = this.getNode(null, strKey, CreateMode.DONT_CREATE, false);
        if (node != null)
        {
            String key = strKey;
            if (key.lastIndexOf('/') != -1)
                key = key.substring(key.lastIndexOf('/') + 1);
            Node nodeStart = node.getParentNode();
            NodeList nodeList = ((Element)nodeStart).getElementsByTagName(key);
            if (nodeList != null)
            {
                for (int i = 0; i < nodeList.getLength(); i++)
                {
                    if (nodeList.item(i).getParentNode() == nodeStart)
                        iCount++;    // Get the last child.
                }
            }
        }
        return iCount;   // Override this
    }
468142
public T max() {
        TObjectIntIterator<T> iter = counts.iterator();
        int maxCount = -1;
        T max = null;
        while (iter.hasNext()) {
            iter.advance();
            int count = iter.value();
            if (count > maxCount) {
                max = iter.key();
                maxCount = count;
            }
        }
        return max;
    }
335103
public Node nextAvailableNode() {
        if (!isInit) {
            init();
        }
        currentNodeIndex++;
        if (currentNodeIndex >= allNodes.length) {
            currentNodeIndex = 0;
        }
        return currentNode();
    }
164487
public int getHeight() {
    int levels = 0;
    N node = getRoot();

    while(!node.isLeaf()) {
      if(node.getNumEntries() > 0) {
        node = getNode(node.getEntry(0));
        levels++;
      }
    }
    return levels;
  }
253318
public int size() {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "size");

    /* Because the table could be 'resized' (and therefore replaced) during   */
    /* the method we get a local ref to the current one & use it throughout.  */
    Entry[] safeTable = table;

    long count = 0;
    Entry current;

    /* Go through the linked lists in the table, counting non-null entries    */
    for (int i = 0; i < safeTable.length; i++) {
      current = safeTable[i];
      while (current != null) {
        count++;
        current = current.next;
      }
    }

    if (count > Integer.MAX_VALUE) {
      count = Integer.MAX_VALUE;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "size",  (int)count);
    return (int)count;
  }
1152848
private int getElementIndex(Node node) {
        final String nodeName = node.getNodeName();

        int count = 1;
        for (Node previousSibling = node.getPreviousSibling();
                previousSibling != null;
                previousSibling = previousSibling.getPreviousSibling()) {
            if (previousSibling.getNodeType() == Node.ELEMENT_NODE
                    && previousSibling.getNodeName().equals(nodeName)) {
                count++;
            }
        }

        return count;
    }
558224
public int getLength()
  {

    // It is assumed that the getChildNodes call synchronized
    // the children. Therefore, we can access the first child
    // reference directly.
    int count = 0;

    for (ElemTemplateElement node = m_firstChild; node != null;
            node = node.m_nextSibling)
    {
      count++;
    }

    return count;
  }
1027826
public int numberOfElements() {
        int n = 0;
        for (SortedSet<Integer> cell : cells) {
            n += cell.size();
        }
        return n;
    }
775304
@Deprecated
	public int count() {
		int count = (clusteringFeature != null) ? 1 : 0;
		for (ClusteringTreeNode child : children) {
			count += child.count();
		}
		return count;
	}