Class RandomPositionIterator
java.lang.Object
io.github.projectunified.blockutil.core.iterator.AbstractPositionIterator
io.github.projectunified.blockutil.core.iterator.BasePositionIterator
io.github.projectunified.blockutil.iterator.RandomPositionIterator
- All Implemented Interfaces:
PositionIterator,Iterator<Position>
The
PositionIterator that iterates randomly-
Field Summary
Fields inherited from class io.github.projectunified.blockutil.core.iterator.AbstractPositionIterator
box -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.github.projectunified.blockutil.core.iterator.BasePositionIterator
getCurrent, hasNext, nextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
RandomPositionIterator
Create a newRandomPositionIterator- Parameters:
box- the box
-
-
Method Details
-
reset
public void reset()Description copied from interface:PositionIteratorReset the iterator- Specified by:
resetin interfacePositionIterator- Overrides:
resetin classBasePositionIterator
-
initial
Description copied from class:BasePositionIteratorGet the initialPosition- Specified by:
initialin classBasePositionIterator- Returns:
- the initial position
-
getContinue
Description copied from class:BasePositionIteratorGet the nextPosition- Specified by:
getContinuein classBasePositionIterator- Parameters:
current- the current position- Returns:
- the next position
- Throws:
NoSuchElementException- if there is no next position
-
hasContinue
Description copied from class:BasePositionIteratorCheck if there is a nextPosition- Specified by:
hasContinuein classBasePositionIterator- Parameters:
current- the current position- Returns:
- true if there is a next position
-