Class ProgressIterator<V>
java.lang.Object
com.sk89q.worldedit.util.task.progress.ProgressIterator<V>
- Type Parameters:
V
- the type
- All Implemented Interfaces:
ProgressObservable
,Iterator<V>
An iterator that keeps track of how many entries have been visited and
calculates a "percent completed" using a provided total count.
The returned progress percentage will always be between 0 or 1 (inclusive). If the iterator returns more entries than the total count, then 100% will be returned for the progress.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> ProgressIterator<V>
Create a new instance.static <V> ProgressIterator<V>
Create a new instance from a list.Get the current percentage of completion.boolean
hasNext()
next()
void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
getProgress
Description copied from interface:ProgressObservable
Get the current percentage of completion.- Specified by:
getProgress
in interfaceProgressObservable
- Returns:
- a progress object
-
create
Create a new instance.- Type Parameters:
V
- the type- Parameters:
iterator
- the iteratorcount
- the number of objects- Returns:
- an instance
-
create
Create a new instance from a list.- Type Parameters:
V
- the type- Parameters:
list
- a list- Returns:
- an instance
-