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 Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR> -
Field Summary
FieldsFields inherited from interface Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidintprivate Boxcurrent()longprivate BoxgetNext()private BoxgetNextInlineChild(List<? extends Object> inlineChilds) private booleanhasChildren(Box bx) private booleanhasNext()private voidnext()private voidsetState(DescendantBoxSpliterator.State newState) booleantryAdvance(Consumer<? super Box> action) trySplit()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:
tryAdvancein interfaceSpliterator<Box>
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<Box>
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<Box>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<Box>
-