org.apache.velocity.anakia
public class NodeList extends Object implements List, Cloneable
NodeList
).
Version: $Id: NodeList.java,v 1.2.4.1 2004/03/03 23:22:04 geirm Exp $
Nested Class Summary | |
---|---|
static class | NodeList.AttributeXMLOutputter
A special subclass of XMLOutputter that will be used to output
Attribute nodes. |
Field Summary | |
---|---|
static NodeList.AttributeXMLOutputter | DEFAULT_OUTPUTTER |
List | nodes The contained nodes |
Constructor Summary | |
---|---|
NodeList()
Creates an empty node list. | |
NodeList(Document document)
Creates a node list that holds a single Document node. | |
NodeList(Element element)
Creates a node list that holds a single Element node. | |
NodeList(Object object) | |
NodeList(List nodes)
Creates a node list that holds a list of nodes. | |
NodeList(List nodes, boolean copy)
Creates a node list that holds a list of nodes. |
Method Summary | |
---|---|
boolean | add(Object o) |
void | add(int index, Object o) |
boolean | addAll(Collection c) |
boolean | addAll(int index, Collection c) |
void | clear() |
Object | clone()
Returns a NodeList that contains the same nodes as this node list. |
void | cloneNodes() |
boolean | contains(Object o) |
boolean | containsAll(Collection c) |
boolean | equals(Object o)
Tests for equality with another object. |
Object | get(int index) |
List | getList()
Retrieves the underlying list used to store the nodes. |
int | hashCode()
Returns the hash code of the contained list. |
int | indexOf(Object o) |
boolean | isEmpty() |
Iterator | iterator() |
int | lastIndexOf(Object o) |
ListIterator | listIterator() |
ListIterator | listIterator(int index) |
Object | remove(int index) |
boolean | remove(Object o) |
boolean | removeAll(Collection c) |
boolean | retainAll(Collection c) |
NodeList | selectNodes(String xpathString)
Applies an XPath expression to the node list and returns the resulting
node list. |
Object | set(int index, Object o) |
int | size() |
List | subList(int fromIndex, int toIndex) |
Object[] | toArray() |
Object[] | toArray(Object[] a) |
String | toString()
This method returns the string resulting from concatenation of string
representations of its nodes. |
Parameters: nodes the list of nodes this template should hold. The created template will copy the passed nodes list, so changes to the passed list will not affect the model.
Parameters: nodes the list of nodes this template should hold. copy if true, the created template will copy the passed nodes list, so changes to the passed list will not affect the model. If false, the model will reference the passed list and will sense changes in it, altough no operations on the list will be synchronized.
Throws: CloneNotSupportedException if the contained list's class does not have an accessible no-arg constructor.
Parameters: o the object to test for equality
Returns: true if the other object is also a NodeList and their contained List objects evaluate as equals.
List
interface
of this class itself. You would probably access the underlying list only for
synchronization purposes.Parameters: xpathExpression the XPath expression you wish to apply
Returns: a NodeList representing the nodes that are the result of application of the XPath to the current node list. It can be empty.