Class NodeVector

java.lang.Object
org.loboevolution.apache.xml.utils.NodeVector
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
NodeSetDTM

public class NodeVector extends Object implements Cloneable
A very simple table that stores a list of Nodes.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    Number of nodes in this NodeVector.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addElement(int value)
    Append a Node onto the vector.
    boolean
    contains(int s)
    Tell if the table contains the given node.
    int
    elementAt(int i)
    Get the nth element.
    int
    indexOf(int elem)
    Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
    int
    indexOf(int elem, int index)
    Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
    void
    insertElementAt(int value, int at)
    Inserts the specified node in this vector at the specified index.
    final int
    Return the node at the top of the stack without popping the stack.
    void
    Set the length to zero, but don't clear the array.
    int
    Get the length of the list.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_firstFree

      protected int m_firstFree
      Number of nodes in this NodeVector.
  • Constructor Details

    • NodeVector

      public NodeVector()
      Default constructor.
  • Method Details

    • clone

      public Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • size

      public int size()
      Get the length of the list.
      Returns:
      Number of nodes in this NodeVector
    • addElement

      public void addElement(int value)
      Append a Node onto the vector.
      Parameters:
      value - Node to add to the vector
    • peepOrNull

      public final int peepOrNull()
      Return the node at the top of the stack without popping the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.
      Returns:
      Node at the top of the stack or null if stack is empty.
    • insertElementAt

      public void insertElementAt(int value, int at)
      Inserts the specified node in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.
      Parameters:
      value - Node to insert
      at - Position where to insert
    • RemoveAllNoClear

      public void RemoveAllNoClear()
      Set the length to zero, but don't clear the array.
    • elementAt

      public int elementAt(int i)
      Get the nth element.
      Parameters:
      i - Index of node to get
      Returns:
      Node at specified index
    • contains

      public boolean contains(int s)
      Tell if the table contains the given node.
      Parameters:
      s - Node to look for
      Returns:
      True if the given node was found.
    • indexOf

      public int indexOf(int elem, int index)
      Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
      Parameters:
      elem - Node to look for
      index - Index of where to start the search
      Returns:
      the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.
    • indexOf

      public int indexOf(int elem)
      Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.
      Parameters:
      elem - Node to look for
      Returns:
      the index of the first occurrence of the object argument in this vector at position index or later in the vector; returns -1 if the object is not found.