Package com.openhtmltopdf.util
Class DescendantBoxSpliterator
java.lang.Object
com.openhtmltopdf.util.DescendantBoxSpliterator
- All Implemented Interfaces:
Spliterator<Box>
A spliterator that can be used to create a stream of descendant boxes in
breadth first order.
NOTE: This is likely slower than simply creating a box list recursively for small number of descendants but gets relatively faster (and uses less memory) as the list of descendants increases in size.
NOTE: This is likely slower than simply creating a box list recursively for small number of descendants but gets relatively faster (and uses less memory) as the list of descendants increases in size.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,
T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
FieldsFields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
int
private Box
current()
long
private Box
getNext()
private Box
getNextInlineChild
(List<? extends Object> inlineChilds) private boolean
hasChildren
(Box bx) private boolean
hasNext()
private void
next()
private void
setState
(DescendantBoxSpliterator.State newState) boolean
tryAdvance
(Consumer<? super Box> action) 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
-
Field Details
-
unprocessed
-
curState
-
childIndex
private int childIndex
-
-
Constructor Details
-
DescendantBoxSpliterator
-
-
Method Details
-
hasChildren
-
add
-
next
private void next() -
hasNext
private boolean hasNext() -
current
-
setState
-
getNext
-
getNextInlineChild
-
tryAdvance
- Specified by:
tryAdvance
in interfaceSpliterator<Box>
-
trySplit
- Specified by:
trySplit
in interfaceSpliterator<Box>
-
estimateSize
public long estimateSize()- Specified by:
estimateSize
in interfaceSpliterator<Box>
-
characteristics
public int characteristics()- Specified by:
characteristics
in interfaceSpliterator<Box>
-