|
JAPI 0.9.0 Yet another Java API API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.japi.xml.NodeListIterator<T>
public class NodeListIterator<T extends Node>
A combined iterable / iterator implementation for iterating over NodeLists.
Constructor Summary | |
---|---|
NodeListIterator(Element item,
short nodeType)
Create a NodeListIterator. |
|
NodeListIterator(Element item,
String childName)
Create a NodeListIterator. |
|
NodeListIterator(NodeList nodeList)
Create a NodeListIterator. |
|
NodeListIterator(XPath xpath,
Element item,
String expression)
Create a NodeListIterator. |
Method Summary | |
---|---|
static Element |
getFirstChild(Element el,
String childName)
Convenience helper method for getting the first child of an element that is an element with a specific name. |
boolean |
hasNext()
Returns true if the iteration has more elements. |
Iterator<T> |
iterator()
Returns an iterator over a set of elements of type T. |
T |
next()
Returns the next element in the iteration. |
void |
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). |
int |
size()
Get the number of elements this iterator would iterate over all. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeListIterator(@NotNull NodeList nodeList)
nodeList
- NodeList to iterate overpublic NodeListIterator(@NotNull Element item, short nodeType)
item
- Element to evaluate againstnodeType
- node type of childrenpublic NodeListIterator(@NotNull Element item, @NotNull String childName)
item
- Element to evaluate againstchildName
- name of child elementpublic NodeListIterator(@NotNull XPath xpath, @NotNull Element item, @NotNull String expression) throws XPathExpressionException
xpath
- XPath to evaulate againstitem
- Object to evaluate againstexpression
- XPath expression to evaluate
XPathExpressionException
- in case of xpath errorsMethod Detail |
---|
@Nullable public static Element getFirstChild(Element el, String childName)
el
- element to get child ofchildName
- name of child element to get
null
if no such child element@NotNull public Iterator<T> iterator()
iterator
in interface Iterable<T extends Node>
public boolean hasNext()
hasNext
in interface Iterator<T extends Node>
@NotNull public T next() throws NoSuchElementException
Iterator.hasNext()
method returns false will
return each element in the underlying collection exactly once.
next
in interface Iterator<T extends Node>
NoSuchElementException
- iteration has no more elements.public void remove()
remove
in interface Iterator<T extends Node>
public int size()
|
JAPI Yet another Java API API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |