|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xalan.utils.NodeVector | +--org.apache.xpath.NodeSet
**For advanced use only** The NodeSet class can act as either a NodeVector, NodeList, or NodeIterator. However, in order for it to act as a NodeVector or NodeList, it's required that setShouldCacheNodes(true) be called before the first nextNode() is called, in order that nodes can be added as they are fetched. Derived classes that implement iterators must override runTo(int index), in order that they may run the iteration to the given index.
Constructor Summary | |
NodeSet()
**For advanced use only** Create an empty nodelist. |
|
NodeSet(int blocksize)
**For advanced use only** Create an empty nodelist. |
|
NodeSet(Node node)
**For advanced use only** Create a NodeSet, and copy the members of the given nodelist into it. |
|
NodeSet(NodeIterator ni)
**For advanced use only** Create a NodeSet, and copy the members of the given nodelist into it. |
|
NodeSet(NodeList nodelist)
**For advanced use only** Create a NodeSet, and copy the members of the given nodelist into it. |
|
NodeSet(NodeSet nodelist)
**For advanced use only** Create a NodeSet, and copy the members of the given NodeSet into it. |
Method Summary | |
void |
addElement(Node value)
**For advanced use only** Append a Node onto the vector. |
void |
addNode(Node n)
**For advanced use only** Add a node. |
int |
addNodeInDocOrder(Node node,
boolean test,
XPathContext support)
**For advanced use only** Add the node into a vector of nodes where it should occur in document order. |
int |
addNodeInDocOrder(Node node,
XPathContext support)
**For advanced use only** Add the node into a vector of nodes where it should occur in document order. |
void |
addNodes(NodeIterator iterator)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. |
void |
addNodes(NodeList nodelist)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. |
void |
addNodes(NodeSet ns)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. |
void |
addNodesInDocOrder(NodeIterator iterator,
XPathContext support)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. |
void |
addNodesInDocOrder(NodeList nodelist,
XPathContext support)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. |
void |
appendNodes(NodeVector nodes)
**For advanced use only** Append the nodes to the list. |
java.lang.Object |
clone()
**For advanced use only** Get a cloned LocPathIterator. |
NodeIterator |
cloneWithReset()
**For advanced use only** Get a cloned Iterator. |
boolean |
contains(Node s)
**For advanced use only** Tell if the table contains the given node. |
void |
detach()
**For advanced use only** Detaches the iterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state. |
Node |
elementAt(int i)
**For advanced use only** Get the nth element. |
Node |
getCurrentNode()
**For advanced use only** Return the last fetched node. |
int |
getCurrentPos()
**For advanced use only** Get the current position, which is one less than the next nextNode() call will retreave. |
boolean |
getExpandEntityReferences()
**For advanced use only** The value of this flag determines whether the children of entity reference nodes are visible to the iterator. |
NodeFilter |
getFilter()
**For advanced use only** The filter used to screen nodes. |
int |
getLength()
**For advanced use only** The number of nodes in the list. |
Node |
getRoot()
**For advanced use only** The root node of the Iterator, as specified when it was created. |
boolean |
getShouldCacheNodes()
**For advanced use only** |
int |
getWhatToShow()
**For advanced use only** This attribute determines which node types are presented via the iterator. |
int |
indexOf(Node elem)
**For advanced use only** Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. |
int |
indexOf(Node elem,
int index)
**For advanced use only** Searches for the first occurence of the given argument, beginning the search at index, and testing for equality using the equals method. |
void |
insertElementAt(Node value,
int at)
**For advanced use only** Inserts the specified node in this vector at the specified index. |
void |
insertNode(Node n,
int pos)
**For advanced use only** Insert a node at a given position. |
boolean |
isFresh()
**For advanced use only** Tells if this NodeSet is "fresh", in other words, if the first nextNode() that is called will return the first node in the set. |
Node |
item(int index)
**For advanced use only** Returns the index th item in the collection. |
Node |
nextNode()
**For advanced use only** Returns the next node in the set and advances the position of the iterator in the set. |
Node |
previousNode()
**For advanced use only** Returns the previous node in the set and moves the position of the iterator backwards in the set. |
void |
removeAllElements()
**For advanced use only** Inserts the specified node in this vector at the specified index. |
boolean |
removeElement(Node s)
**For advanced use only** Removes the first occurrence of the argument from this vector. |
void |
removeElementAt(int i)
**For advanced use only** Deletes the component at the specified index. |
void |
removeNode(Node n)
**For advanced use only** Remove a node. |
void |
reset()
**For advanced use only** Reset the iterator. |
void |
runTo(int index)
**For advanced use only** If an index is requested, NodeSet will call this method to run the iterator to the index. |
void |
setCurrentPos(int i)
**For advanced use only** Set the current position in the node set. |
void |
setElementAt(Node node,
int index)
**For advanced use only** Sets the component at the specified index of this vector to be the specified object. |
void |
setShouldCacheNodes(boolean b)
**For advanced use only** If setShouldCacheNodes(true) is called, then nodes will be cached. |
int |
size()
**For advanced use only** Get the length of the list. |
Methods inherited from class org.apache.xalan.utils.NodeVector |
peepOrNull,
peepTail,
peepTailSub1,
pop,
popPair,
popQuick,
push,
pushPair,
setTail,
setTailSub1 |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public NodeSet()
public NodeSet(int blocksize)
public NodeSet(NodeList nodelist)
public NodeSet(NodeSet nodelist)
public NodeSet(NodeIterator ni)
public NodeSet(Node node)
Method Detail |
public Node getRoot()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public NodeIterator cloneWithReset() throws java.lang.CloneNotSupportedException
public void reset()
public int getWhatToShow()
NodeFilter
interface.public NodeFilter getFilter()
public boolean getExpandEntityReferences()
public Node nextNode() throws DOMException
Node
in the set being iterated over, or
null
if there are no more members in that set.detach
method was invoked.public Node previousNode() throws DOMException
Node
in the set being iterated over,
ornull
if there are no more members in that set.detach
method was invoked.public void detach()
detach
has been invoked, calls to
nextNode
orpreviousNode
will raise the
exception INVALID_STATE_ERR.public boolean isFresh()
public void runTo(int index)
public Node item(int index)
index
th item in the collection. If
index
is greater than or equal to the number of nodes in
the list, this returns null
.index
- Index into the collection.index
th position in the
NodeList
, or null
if that is not a valid
index.public int getLength()
length-1
inclusive.public void addNode(Node n)
public void insertNode(Node n, int pos)
public void removeNode(Node n)
public void addNodes(NodeList nodelist)
public void addNodes(NodeSet ns)
public void addNodes(NodeIterator iterator)
public void addNodesInDocOrder(NodeList nodelist, XPathContext support)
public void addNodesInDocOrder(NodeIterator iterator, XPathContext support)
public int addNodeInDocOrder(Node node, boolean test, XPathContext support)
v
- Vector of nodes, presumably containing Nodesobj
- Node object.test
- true if we should test for doc orderpublic int addNodeInDocOrder(Node node, XPathContext support)
v
- Vector of nodes, presumably containing Nodesobj
- Node object.public int size()
public void addElement(Node value)
public void insertElementAt(Node value, int at)
public void appendNodes(NodeVector nodes)
public void removeAllElements()
public boolean removeElement(Node s)
public void removeElementAt(int i)
public void setElementAt(Node node, int index)
public Node elementAt(int i)
public boolean contains(Node s)
public int indexOf(Node elem, int index)
public int indexOf(Node elem)
public int getCurrentPos()
public void setCurrentPos(int i)
i
- Must be a valid index.public Node getCurrentNode()
public boolean getShouldCacheNodes()
public void setShouldCacheNodes(boolean b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |