Package me.tongfei.progressbar.wrapped
Class ProgressBarWrappedSpliterator<T>
java.lang.Object
me.tongfei.progressbar.wrapped.ProgressBarWrappedSpliterator<T>
- All Implemented Interfaces:
AutoCloseable,Spliterator<T>
public class ProgressBarWrappedSpliterator<T>
extends Object
implements Spliterator<T>, AutoCloseable
Any spliterator whose parallel iteration is tracked by a multi-threaded progress bar.
- Since:
- 0.7.2
-
Nested Class Summary
Nested 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
FieldsModifier and TypeFieldDescriptionprivate Set<Spliterator<T>> private ProgressBarprivate Spliterator<T> Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsModifierConstructorDescriptionProgressBarWrappedSpliterator(Spliterator<T> underlying, ProgressBar pb) privateProgressBarWrappedSpliterator(Spliterator<T> underlying, ProgressBar pb, Set<Spliterator<T>> openChildren) -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()longComparator<? super T> private voidregisterChild(Spliterator<T> child) private voidbooleantryAdvance(Consumer<? super T> action) trySplit()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Spliterator
forEachRemaining, getExactSizeIfKnown, hasCharacteristics
-
Field Details
-
underlying
-
pb
-
openChildren
-
-
Constructor Details
-
ProgressBarWrappedSpliterator
-
ProgressBarWrappedSpliterator
private ProgressBarWrappedSpliterator(Spliterator<T> underlying, ProgressBar pb, Set<Spliterator<T>> openChildren)
-
-
Method Details
-
getProgressBar
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
registerChild
-
removeThis
private void removeThis() -
tryAdvance
- Specified by:
tryAdvancein interfaceSpliterator<T>
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<T>
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<T>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<T>
-
getComparator
- Specified by:
getComparatorin interfaceSpliterator<T>
-