Package org.shredzone.commons.xml
Class NodeListSpliterator
- java.lang.Object
-
- org.shredzone.commons.xml.NodeListSpliterator
-
- All Implemented Interfaces:
Spliterator<Node>
@ParametersAreNonnullByDefault public class NodeListSpliterator extends Object implements Spliterator<Node>
- Author:
- Richard "Shred" Körber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T extends Object,T_CONS extends Object,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
-
-
Field Summary
-
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
-
Constructor Summary
Constructors Constructor Description NodeListSpliterator(NodeList list)
Creates a newNodeListSpliterator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
characteristics()
long
estimateSize()
Stream<Node>
stream()
boolean
tryAdvance(Consumer<? super Node> action)
Spliterator<Node>
trySplit()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Spliterator
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
-
-
-
-
Constructor Detail
-
NodeListSpliterator
public NodeListSpliterator(NodeList list)
Creates a newNodeListSpliterator
.- Parameters:
list
-NodeList
to create aNodeListSpliterator
of
-
-
Method Detail
-
stream
@Nonnull public Stream<Node> stream()
Creates a newStream
ofNode
for this spliterator.This is a convenience call. It just invokes
StreamSupport.stream(Spliterator, boolean)
.- Returns:
Stream
of nodes
-
tryAdvance
public boolean tryAdvance(Consumer<? super Node> action)
- Specified by:
tryAdvance
in interfaceSpliterator<Node>
-
trySplit
public Spliterator<Node> trySplit()
- Specified by:
trySplit
in interfaceSpliterator<Node>
-
estimateSize
public long estimateSize()
- Specified by:
estimateSize
in interfaceSpliterator<Node>
-
characteristics
public int characteristics()
- Specified by:
characteristics
in interfaceSpliterator<Node>
-
-