Package me.tongfei.progressbar.wrapped
Class ProgressBarWrappedSpliterator<T>
- java.lang.Object
-
- me.tongfei.progressbar.wrapped.ProgressBarWrappedSpliterator<T>
-
- All Implemented Interfaces:
java.lang.AutoCloseable,java.util.Spliterator<T>
public class ProgressBarWrappedSpliterator<T> extends java.lang.Object implements java.util.Spliterator<T>, java.lang.AutoCloseableAny 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
java.util.Spliterator.OfDouble, java.util.Spliterator.OfInt, java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive<T extends java.lang.Object,T_CONS extends java.lang.Object,T_SPLITR extends java.util.Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.util.Spliterator<T>>openChildrenprivate ProgressBarpbprivate java.util.Spliterator<T>underlying
-
Constructor Summary
Constructors Modifier Constructor Description ProgressBarWrappedSpliterator(java.util.Spliterator<T> underlying, ProgressBar pb)privateProgressBarWrappedSpliterator(java.util.Spliterator<T> underlying, ProgressBar pb, java.util.Set<java.util.Spliterator<T>> openChildren)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcharacteristics()voidclose()longestimateSize()java.util.Comparator<? super T>getComparator()ProgressBargetProgressBar()private voidregisterChild(java.util.Spliterator<T> child)private voidremoveThis()booleantryAdvance(java.util.function.Consumer<? super T> action)java.util.Spliterator<T>trySplit()
-
-
-
Field Detail
-
underlying
private java.util.Spliterator<T> underlying
-
pb
private ProgressBar pb
-
openChildren
private java.util.Set<java.util.Spliterator<T>> openChildren
-
-
Constructor Detail
-
ProgressBarWrappedSpliterator
public ProgressBarWrappedSpliterator(java.util.Spliterator<T> underlying, ProgressBar pb)
-
ProgressBarWrappedSpliterator
private ProgressBarWrappedSpliterator(java.util.Spliterator<T> underlying, ProgressBar pb, java.util.Set<java.util.Spliterator<T>> openChildren)
-
-
Method Detail
-
getProgressBar
public ProgressBar getProgressBar()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
registerChild
private void registerChild(java.util.Spliterator<T> child)
-
removeThis
private void removeThis()
-
tryAdvance
public boolean tryAdvance(java.util.function.Consumer<? super T> action)
- Specified by:
tryAdvancein interfacejava.util.Spliterator<T>
-
trySplit
public java.util.Spliterator<T> trySplit()
- Specified by:
trySplitin interfacejava.util.Spliterator<T>
-
estimateSize
public long estimateSize()
- Specified by:
estimateSizein interfacejava.util.Spliterator<T>
-
characteristics
public int characteristics()
- Specified by:
characteristicsin interfacejava.util.Spliterator<T>
-
-