Class NodeVector
java.lang.Object
org.loboevolution.apache.xml.utils.NodeVector
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
NodeSetDTM
A very simple table that stores a list of Nodes.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(int value) Append a Node onto the vector.clone()
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
size()
Get the length of the list.
-
Field Details
-
m_firstFree
protected int m_firstFreeNumber of nodes in this NodeVector.
-
-
Constructor Details
-
NodeVector
public NodeVector()Default constructor.
-
-
Method Details
-
clone
- Overrides:
clone
in classObject
- 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 insertat
- 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 forindex
- 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.
-