Package com.openhtmltopdf.util
Class DescendantBoxSpliterator
- java.lang.Object
-
- com.openhtmltopdf.util.DescendantBoxSpliterator
-
- All Implemented Interfaces:
Spliterator<Box>
public class DescendantBoxSpliterator extends Object implements 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.
-
-
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 DescendantBoxSpliterator(Box parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcharacteristics()longestimateSize()booleantryAdvance(Consumer<? super Box> action)Spliterator<Box>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
-
DescendantBoxSpliterator
public DescendantBoxSpliterator(Box parent)
-
-
Method Detail
-
tryAdvance
public boolean tryAdvance(Consumer<? super Box> action)
- Specified by:
tryAdvancein interfaceSpliterator<Box>
-
trySplit
public Spliterator<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>
-
-