BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xml.utils
Class NodeVector

java.lang.Object
  |
  +--weblogic.apache.xml.utils.NodeVector
Direct Known Subclasses:
NodeSet

public class NodeVector
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

A very simple table that stores a list of Nodes.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

See Also:
Serialized Form

Field Summary
protected  int m_firstFree
          Number of nodes in this NodeVector.
 
Constructor Summary
NodeVector()
          Default constructor.
NodeVector(int blocksize)
          Construct a NodeVector, using the given block size.
 
Method Summary
 void addElement(org.w3c.dom.Node value)
          Append a Node onto the vector.
 void appendNodes(NodeVector nodes)
          Append the nodes to the list.
 java.lang.Object clone()
          Get a cloned LocPathIterator.
 boolean contains(org.w3c.dom.Node s)
          Tell if the table contains the given node.
 org.w3c.dom.Node elementAt(int i)
          Get the nth element.
 int indexOf(org.w3c.dom.Node 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(org.w3c.dom.Node 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(org.w3c.dom.Node value, int at)
          Inserts the specified node in this vector at the specified index.
 org.w3c.dom.Node peepOrNull()
          Return the node at the top of the stack without popping the stack.
 org.w3c.dom.Node peepTail()
          Return the node at the tail of the vector without popping Special purpose method for TransformerImpl, pushElemTemplateElement.
 org.w3c.dom.Node peepTailSub1()
          Return the node one position from the tail without popping.
 org.w3c.dom.Node pop()
          Pop a node from the tail of the vector and return the result.
 org.w3c.dom.Node popAndTop()
          Pop a node from the tail of the vector and return the top of the stack after the pop.
 void popPair()
          Pop a pair of nodes from the tail of the stack.
 void popQuick()
          Pop a node from the tail of the vector.
 void push(org.w3c.dom.Node value)
          Append a Node onto the vector.
 void pushPair(org.w3c.dom.Node v1, org.w3c.dom.Node v2)
          Push a pair of nodes into the stack.
 void removeAllElements()
          Inserts the specified node in this vector at the specified index.
 boolean removeElement(org.w3c.dom.Node s)
          Removes the first occurrence of the argument from this vector.
 void removeElementAt(int i)
          Deletes the component at the specified index.
 void setElementAt(org.w3c.dom.Node node, int index)
          Sets the component at the specified index of this vector to be the specified object.
 void setTail(org.w3c.dom.Node n)
          Set the tail of the stack to the given node.
 void setTailSub1(org.w3c.dom.Node n)
          Set the given node one position from the tail.
 int size()
          Get the length of the list.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_firstFree

protected int m_firstFree
Number of nodes in this NodeVector.
Constructor Detail

NodeVector

public NodeVector()
Default constructor.

NodeVector

public NodeVector(int blocksize)
Construct a NodeVector, using the given block size.

Parameters:
blocksize - Size of blocks to allocate
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Get a cloned LocPathIterator.

Returns:
A clone of this
Throws:
java.lang.CloneNotSupportedException -  
Overrides:
clone in class java.lang.Object

size

public int size()
Get the length of the list.

Returns:
Number of nodes in this NodeVector

addElement

public void addElement(org.w3c.dom.Node value)
Append a Node onto the vector.

Parameters:
value - Node to add to the vector

push

public final void push(org.w3c.dom.Node value)
Append a Node onto the vector.

Parameters:
value - Node to add to the vector

pop

public final org.w3c.dom.Node pop()
Pop a node from the tail of the vector and return the result.

Returns:
the node at the tail of the vector

popAndTop

public final org.w3c.dom.Node popAndTop()
Pop a node from the tail of the vector and return the top of the stack after the pop.

Returns:
The top of the stack after it's been popped

popQuick

public final void popQuick()
Pop a node from the tail of the vector.


peepOrNull

public final org.w3c.dom.Node 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.

pushPair

public final void pushPair(org.w3c.dom.Node v1,
                           org.w3c.dom.Node v2)
Push a pair of nodes into the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Parameters:
v1 - First node to add to vector
v2 - Second node to add to vector

popPair

public final void popPair()
Pop a pair of nodes from the tail of the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.


setTail

public final void setTail(org.w3c.dom.Node n)
Set the tail of the stack to the given node. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Parameters:
n - Node to set at the tail of vector

setTailSub1

public final void setTailSub1(org.w3c.dom.Node n)
Set the given node one position from the tail. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Parameters:
n - Node to set

peepTail

public final org.w3c.dom.Node peepTail()
Return the node at the tail of the vector without popping Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Returns:
Node at the tail of the vector

peepTailSub1

public final org.w3c.dom.Node peepTailSub1()
Return the node one position from the tail without popping. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Returns:
Node one away from the tail

insertElementAt

public void insertElementAt(org.w3c.dom.Node 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

appendNodes

public void appendNodes(NodeVector nodes)
Append the nodes to the list.

Parameters:
nodes - NodeVector to append to this list

removeAllElements

public void removeAllElements()
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.


removeElement

public boolean removeElement(org.w3c.dom.Node s)
Removes the first occurrence of the argument from this vector. If the object is found in this vector, each component in the vector with an index greater or equal to the object's index is shifted downward to have an index one smaller than the value it had previously.

Parameters:
s - Node to remove from the list
Returns:
True if the node was successfully removed

removeElementAt

public void removeElementAt(int i)
Deletes the component at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously.

Parameters:
i - Index of node to remove

setElementAt

public void setElementAt(org.w3c.dom.Node node,
                         int index)
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded. The index must be a value greater than or equal to 0 and less than the current size of the vector.

Parameters:
node - Node to set
index - Index of where to set the node

elementAt

public org.w3c.dom.Node elementAt(int i)
Get the nth element.

Parameters:
i - Index of node to get
Returns:
Node at specified index

contains

public boolean contains(org.w3c.dom.Node 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(org.w3c.dom.Node 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(org.w3c.dom.Node 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.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.