Top Description Fields Constructors Methods
groovy.util

public Class NodeList

extends ArrayList
Class Inheritance
Imports
groovy.lang.Closure, .DelegatingMetaClass, .GroovyRuntimeException, .GroovySystem, .MetaClass, groovy.namespace.QName, java.util.ArrayList, .Collection, .Iterator, .List

A List implementation which is returned by queries on a Node which provides some XPath like helper methods for GPath.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
public
NodeList(Collection<E> collection)

public
NodeList(int size)

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the clone
clone
()

Overrides java.util.ArrayList.clone.

Creates a new NodeList containing the same elements as the original (but cloned in the case of Nodes).
public NodeList

Returns:

the nodes of interest which match name
getAt
(String
the name or shortcut key for nodes of interest
name
)

Provides lookup of elements by non-namespaced name.

public NodeList

Returns:

the nodes of interest which match name
getAt
(QName
the name or shortcut key for nodes of interest
name
)

Provides lookup of elements by QName.

public void
plus(Closure<V> c)

public Node
protected static void
setMetaClass(final Class<T> nodelistClass, final MetaClass metaClass)

public String

Returns:

the text value of all the elements in the collection or null
text
()

Returns the text value of all of the elements in the collection.

Inherited from java.util.ArrayList:
addaddaddAlladdAlladdFirstaddLastclearcontainsensureCapacityequalsforEachgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorremoveremoveremoveAllremoveFirstremoveIfremoveLastremoveRangereplaceAllretainAllsetsizesortspliteratorsubListtoArraytoArraytrimToSize

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.ArrayList.serialVersionUID.

Constructor Detail

NodeListback to summary
public NodeList()
NodeListback to summary
public NodeList(Collection<E> collection)
NodeListback to summary
public NodeList(int size)

Method Detail

cloneback to summary
public Object clone()

Overrides java.util.ArrayList.clone.

Creates a new NodeList containing the same elements as the original (but cloned in the case of Nodes).

Returns:Object

the clone

Annotations
@Override
getAtback to summary
public NodeList getAt(String name)

Provides lookup of elements by non-namespaced name.

Parameters
name:String

the name or shortcut key for nodes of interest

Returns:NodeList

the nodes of interest which match name

getAtback to summary
public NodeList getAt(QName name)

Provides lookup of elements by QName.

Parameters
name:QName

the name or shortcut key for nodes of interest

Returns:NodeList

the nodes of interest which match name

plusback to summary
public void plus(Closure<V> c)
replaceNodeback to summary
public Node replaceNode(Closure<V> c)
setMetaClassback to summary
protected static void setMetaClass(final Class<T> nodelistClass, final MetaClass metaClass)
textback to summary
public String text()

Returns the text value of all of the elements in the collection.

Returns:String

the text value of all the elements in the collection or null