public final class Elements extends Object implements Iterable<Element>
A read-only list of elements for traversal purposes.
Changes to the document from which this list was generated
are not reflected in this list. Changes to the individual
Element
objects in the list are reflected.
Modifier and Type | Method and Description |
---|---|
Element | get(int index)
Returns the indexth element in the list.
|
java.util.Iterator<Element> | iterator() |
int | size()
Returns the number of elements in the list.
|
public int size()
Returns the number of elements in the list. This is guaranteed non-negative.
public Element get(int index)
Returns the indexth element in the list.
The first element has index 0. The last element
has index size()-1
.
index
- the element to returnIndexOutOfBoundsException
- if index is negative
or greater than or equal to the size of the listCopyright 2002-2023 Elliotte Rusty Harold
elharo@ibiblio.org