Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.utils

public Class NodeVector

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
com.sun.org.apache.xpath.internal.NodeSetDTM
Imports
java.io.Serializable, com.sun.org.apache.xml.internal.dtm.DTM

A very simple table that stores a list of Nodes.

Field Summary

Modifier and TypeField and Description
private int
m_blocksize

Size of blocks to allocate.

protected int
m_firstFree

Number of nodes in this NodeVector.

private int[]
m_map

Array of nodes this points to.

private int
m_mapSize

Size of the array this points to.

pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
NodeVector()

Default constructor.

public
NodeVector(int
Size of blocks to allocate
blocksize
)

Construct a NodeVector, using the given block size.

Method Summary

Modifier and TypeMethod and Description
public void
addElement(int
Node to add to the vector
value
)

Append a Node onto the vector.

public void
appendNodes(NodeVector
NodeVector to append to this list
nodes
)

Append the nodes to the list.

public Object

Returns:

A clone of this
clone
()

Overrides java.lang.Object.clone.

Get a cloned LocPathIterator.

public boolean

Returns:

True if the given node was found.
contains
(int
Node to look for
s
)

Tell if the table contains the given node.

public int

Returns:

Node at specified index
elementAt
(int
Index of node to get
i
)

Get the nth element.

public int

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
(int
Node to look for
elem
,
int
Index of where to start the search
index
)

Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.

public int

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
(int
Node to look for
elem
)

Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method.

public void
insertElementAt(int
Node to insert
value
,
int
Position where to insert
at
)

Inserts the specified node in this vector at the specified index.

public void
insertInOrder(int
Node to insert
value
)

Insert a node in order in the list.

public final int

Returns:

Node at the top of the stack or null if stack is empty.
peepOrNull
()

Return the node at the top of the stack without popping the stack.

public final int

Returns:

Node at the tail of the vector
peepTail
()

Return the node at the tail of the vector without popping Special purpose method for TransformerImpl, pushElemTemplateElement.

public final int

Returns:

Node one away from the tail
peepTailSub1
()

Return the node one position from the tail without popping.

public final int

Returns:

the node at the tail of the vector
pop
()

Pop a node from the tail of the vector and return the result.

public final int

Returns:

The top of the stack after it's been popped
popAndTop
()

Pop a node from the tail of the vector and return the top of the stack after the pop.

public final void
popPair()

Pop a pair of nodes from the tail of the stack.

public final void
popQuick()

Pop a node from the tail of the vector.

public final void
push(int
Node to add to the vector
value
)

Append a Node onto the vector.

public final void
pushPair(int
First node to add to vector
v1
,
int
Second node to add to vector
v2
)

Push a pair of nodes into the stack.

public void
removeAllElements()

Inserts the specified node in this vector at the specified index.

public void
RemoveAllNoClear()

Set the length to zero, but don't clear the array.

public boolean

Returns:

True if the node was successfully removed
removeElement
(int
Node to remove from the list
s
)

Removes the first occurrence of the argument from this vector.

public void
removeElementAt(int
Index of node to remove
i
)

Deletes the component at the specified index.

public void
setElementAt(int
Node to set
node
,
int
Index of where to set the node
index
)

Sets the component at the specified index of this vector to be the specified object.

public final void
setTail(int
Node to set at the tail of vector
n
)

Set the tail of the stack to the given node.

public final void
setTailSub1(int
Node to set
n
)

Set the given node one position from the tail.

public int

Returns:

Number of nodes in this NodeVector
size
()

Get the length of the list.

public void
sort(int[]
The array to be sorted.
a
,
int
The low index.
lo0
,
int
The high index.
hi0
)

Sort an array using a quicksort algorithm.

public void
sort()

Sort an array using a quicksort algorithm.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_blocksizeback to summary
private int m_blocksize

Size of blocks to allocate.

m_firstFreeback to summary
protected int m_firstFree

Number of nodes in this NodeVector.

m_mapback to summary
private int[] m_map

Array of nodes this points to.

m_mapSizeback to summary
private int m_mapSize

Size of the array this points to.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Constructor Detail

NodeVectorback to summary
public NodeVector()

Default constructor.

NodeVectorback to summary
public NodeVector(int blocksize)

Construct a NodeVector, using the given block size.

Parameters
blocksize:int

Size of blocks to allocate

Method Detail

addElementback to summary
public void addElement(int value)

Append a Node onto the vector.

Parameters
value:int

Node to add to the vector

appendNodesback to summary
public void appendNodes(NodeVector nodes)

Append the nodes to the list.

Parameters
nodes:NodeVector

NodeVector to append to this list

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Get a cloned LocPathIterator.

Returns:Object

A clone of this

Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

containsback to summary
public boolean contains(int s)

Tell if the table contains the given node.

Parameters
s:int

Node to look for

Returns:boolean

True if the given node was found.

elementAtback to summary
public int elementAt(int i)

Get the nth element.

Parameters
i:int

Index of node to get

Returns:int

Node at specified index

indexOfback to summary
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:int

Node to look for

index:int

Index of where to start the search

Returns:int

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.

indexOfback to summary
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:int

Node to look for

Returns:int

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.

insertElementAtback to summary
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:int

Node to insert

at:int

Position where to insert

insertInOrderback to summary
public void insertInOrder(int value)

Insert a node in order in the list.

Parameters
value:int

Node to insert

peepOrNullback to summary
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:int

Node at the top of the stack or null if stack is empty.

peepTailback to summary
public final int peepTail()

Return the node at the tail of the vector without popping Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Returns:int

Node at the tail of the vector

peepTailSub1back to summary
public final int peepTailSub1()

Return the node one position from the tail without popping. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Returns:int

Node one away from the tail

popback to summary
public final int pop()

Pop a node from the tail of the vector and return the result.

Returns:int

the node at the tail of the vector

popAndTopback to summary
public final int popAndTop()

Pop a node from the tail of the vector and return the top of the stack after the pop.

Returns:int

The top of the stack after it's been popped

popPairback to summary
public final void popPair()

Pop a pair of nodes from the tail of the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

popQuickback to summary
public final void popQuick()

Pop a node from the tail of the vector.

pushback to summary
public final void push(int value)

Append a Node onto the vector.

Parameters
value:int

Node to add to the vector

pushPairback to summary
public final void pushPair(int v1, int v2)

Push a pair of nodes into the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Parameters
v1:int

First node to add to vector

v2:int

Second node to add to vector

removeAllElementsback to summary
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.

RemoveAllNoClearback to summary
public void RemoveAllNoClear()

Set the length to zero, but don't clear the array.

removeElementback to summary
public boolean removeElement(int 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:int

Node to remove from the list

Returns:boolean

True if the node was successfully removed

removeElementAtback to summary
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:int

Index of node to remove

setElementAtback to summary
public void setElementAt(int 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:int

Node to set

index:int

Index of where to set the node

setTailback to summary
public final void setTail(int n)

Set the tail of the stack to the given node. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Parameters
n:int

Node to set at the tail of vector

setTailSub1back to summary
public final void setTailSub1(int n)

Set the given node one position from the tail. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical.

Parameters
n:int

Node to set

sizeback to summary
public int size()

Get the length of the list.

Returns:int

Number of nodes in this NodeVector

sortback to summary
public void sort(int[] a, int lo0, int hi0) throws Exception

Sort an array using a quicksort algorithm.

Parameters
a:int[]

The array to be sorted.

lo0:int

The low index.

hi0:int

The high index.

sortback to summary
public void sort() throws Exception

Sort an array using a quicksort algorithm.