Class LinearPositionIterator
java.lang.Object
io.github.projectunified.blockutil.core.iterator.AbstractPositionIterator
io.github.projectunified.blockutil.core.iterator.BasePositionIterator
io.github.projectunified.blockutil.iterator.LinearPositionIterator
- All Implemented Interfaces:
PositionIterator,Iterator<Position>
The
PositionIterator that iterates in a linear way-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe linear subject -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LinearPositionIterator.LinearCoordinateA linear subject for the x-axisstatic final LinearPositionIterator.LinearCoordinateA linear subject for the y-axisstatic final LinearPositionIterator.LinearCoordinateA linear subject for the z-axisFields inherited from class io.github.projectunified.blockutil.core.iterator.AbstractPositionIterator
box -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new iteratorLinearPositionIterator(BlockBox box, LinearPositionIterator.LinearCoordinate... coordinates) Create a new iterator -
Method Summary
Modifier and TypeMethodDescriptiongetContinue(Position current) Get the nextPositionbooleanhasContinue(Position current) Check if there is a nextPositioninitial()Get the initialPositionMethods inherited from class io.github.projectunified.blockutil.core.iterator.BasePositionIterator
getCurrent, hasNext, next, resetMethods 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
-
Field Details
-
X_COORDINATE
A linear subject for the x-axis -
Y_COORDINATE
A linear subject for the y-axis -
Z_COORDINATE
A linear subject for the z-axis
-
-
Constructor Details
-
LinearPositionIterator
Create a new iterator- Parameters:
box- the boxcoordinates- the linear subjects
-
LinearPositionIterator
Create a new iterator- Parameters:
box- the box
-
-
Method Details
-
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
-