| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.velocity.anakia.NodeList
public class NodeList
Provides a class for wrapping a list of JDOM objects primarily for use in template
 engines and other kinds of text transformation tools.
 It has a toString() method that will output the XML serialized form of the
 nodes it contains - again focusing on template engine usage, as well as the
 selectNodes(String) method that helps selecting a different set of nodes
 starting from the nodes in this list. The class also implements the List
 interface by simply delegating calls to the contained list (the subList(int, int)
 method is implemented by delegating to the contained list and wrapping the returned
 sublist into a NodeList).
| Constructor Summary | |
|---|---|
| NodeList()Creates an empty node list. | |
| NodeList(Document document)Creates a node list that holds a single Documentnode. | |
| NodeList(Element element)Creates a node list that holds a single Elementnode. | |
| 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 | |
|---|---|
|  void | add(int index,
    Object o) | 
|  boolean | add(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. | 
|  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. | 
| Methods inherited from class java.lang.Object | 
|---|
| finalize, getClass, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public NodeList()
public NodeList(Document document)
Document node.
document - public NodeList(Element element)
Element node.
element - public NodeList(List nodes)
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.
public NodeList(List nodes,
                boolean copy)
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.| Method Detail | 
|---|
public List getList()
List interface
 of this class itself. You would probably access the underlying list only for
 synchronization purposes.
public String toString()
toString in class Object
public Object clone()
             throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException - if the contained list's class does
 not have an accessible no-arg constructor.public int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in class Objectpublic boolean equals(Object o)
equals in interface Collectionequals in interface Listequals in class Objecto - the object to test for equality
List objects evaluate as equals.public NodeList selectNodes(String xpathString)
xpathString - the XPath expression you wish to apply
public boolean add(Object o)
add in interface Collectionadd in interface ListList.add(java.lang.Object)
public void add(int index,
                Object o)
add in interface ListList.add(int, java.lang.Object)public boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListList.addAll(java.util.Collection)
public boolean addAll(int index,
                      Collection c)
addAll in interface ListList.addAll(int, java.util.Collection)public void clear()
clear in interface Collectionclear in interface ListList.clear()public boolean contains(Object o)
contains in interface Collectioncontains in interface ListList.contains(java.lang.Object)public boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface ListList.containsAll(java.util.Collection)public Object get(int index)
get in interface ListList.get(int)public int indexOf(Object o)
indexOf in interface ListList.indexOf(java.lang.Object)public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListList.isEmpty()public Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface ListList.iterator()public int lastIndexOf(Object o)
lastIndexOf in interface ListList.lastIndexOf(java.lang.Object)public ListIterator listIterator()
listIterator in interface ListList.listIterator()public ListIterator listIterator(int index)
listIterator in interface ListList.listIterator(int)public Object remove(int index)
remove in interface ListList.remove(int)public boolean remove(Object o)
remove in interface Collectionremove in interface ListList.remove(java.lang.Object)public boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListList.removeAll(java.util.Collection)public boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface ListList.retainAll(java.util.Collection)
public Object set(int index,
                  Object o)
set in interface ListList.set(int, java.lang.Object)public int size()
size in interface Collectionsize in interface ListList.size()
public List subList(int fromIndex,
                    int toIndex)
subList in interface ListList.subList(int, int)public Object[] toArray()
toArray in interface CollectiontoArray in interface ListList.toArray()public Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListList.toArray(java.lang.Object[])| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||