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
Constructors -
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, toArrayMethods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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:HTMLCollectionRetrieves a select object or an object from an options collection.- Specified by:
namedItemin interfaceHTMLCollection- Parameters:
name- aStringobject.- Returns:
- a
Elementobject.
-
getLength
public int getLength()Description copied from interface:HTMLCollectiongetLength.
- Specified by:
getLengthin interfaceHTMLCollection- Returns:
- a
Integerobject.
-
item
Description copied from interface:HTMLCollectionitem.
- Specified by:
itemin interfaceHTMLCollection- Parameters:
index- aIntegerobject.- Returns:
- a
Nodeobject.
-
setItem
Description copied from interface:HTMLCollectionitem.
- Specified by:
setItemin interfaceHTMLCollection- Parameters:
index- aIntegerobject.
-