Package org.loboevolution.apache.xpath
Class NodeSet
- All Implemented Interfaces:
Iterable<Node>
,Collection<Node>
,List<Node>
,SequencedCollection<Node>
,HTMLCollection
,ScriptableDelegate
The NodeSet class can act as either a NodeVector, NodeList, or NodeIterator. However, in order
for it to act as a NodeVector or NodeList, it's required that setShouldCacheNodes(true) be called
before the first nextNode() is called, in order that nodes can be added as they are fetched.
Derived classes that implement iterators must override runTo(int index), in order that they may
run the iteration to the given index.
Note that we directly implement the DOM's NodeIterator interface. We do not emulate all the behavior of the standard NodeIterator. In particular, we do not guarantee to present a "live view" of the document ... but in XSLT, the source document should never be mutated, so this should never be an issue.
Thought: Should NodeSet really implement NodeList and NodeIterator, or should there be specific subclasses of it which do so? The advantage of doing it all here is that all NodeSets will respond to the same calls; the disadvantage is that some of them may return less-than-enlightening results when you do so.
-
Constructor Summary
-
Method Summary
Methods inherited from class org.loboevolution.html.node.AbstractList
add, add, addAll, addAll, clear, contains, containsAll, get, getList, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, setList, size, subList, toArray, toArray
Methods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, equals, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
NodeSet
-
-
Method Details
-
namedItem
Description copied from interface:HTMLCollection
Retrieves a select object or an object from an options collection.- Specified by:
namedItem
in interfaceHTMLCollection
- Parameters:
name
- aString
object.- Returns:
- a
Element
object.
-
getLength
public int getLength()Description copied from interface:HTMLCollection
getLength.
- Specified by:
getLength
in interfaceHTMLCollection
- Returns:
- a
Integer
object.
-
item
Description copied from interface:HTMLCollection
item.
- Specified by:
item
in interfaceHTMLCollection
- Parameters:
index
- aInteger
object.- Returns:
- a
Node
object.
-
setItem
Description copied from interface:HTMLCollection
item.
- Specified by:
setItem
in interfaceHTMLCollection
- Parameters:
index
- aInteger
object.
-