Class LinearPositionIterator
java.lang.Object
me.hsgamer.hscore.minecraft.block.iterator.AbstractPositionIterator
me.hsgamer.hscore.minecraft.block.iterator.BasePositionIterator
me.hsgamer.hscore.minecraft.block.impl.iterator.LinearPositionIterator
- All Implemented Interfaces:
Iterator<Position>
,PositionIterator
The
PositionIterator
that iterates in a linear way-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The linear subject -
Field Summary
Modifier and TypeFieldDescriptionstatic final LinearPositionIterator.LinearCoordinate
A linear subject for the x-axisstatic final LinearPositionIterator.LinearCoordinate
A linear subject for the y-axisstatic final LinearPositionIterator.LinearCoordinate
A linear subject for the z-axisFields inherited from class me.hsgamer.hscore.minecraft.block.iterator.AbstractPositionIterator
box
-
Constructor Summary
ConstructorDescriptionCreate a new iteratorLinearPositionIterator
(BlockBox box, LinearPositionIterator.LinearCoordinate... coordinates) Create a new iterator -
Method Summary
Modifier and TypeMethodDescriptiongetContinue
(Position current) Get the nextPosition
boolean
hasContinue
(Position current) Check if there is a nextPosition
initial()
Get the initialPosition
Methods inherited from class me.hsgamer.hscore.minecraft.block.iterator.BasePositionIterator
getCurrent, hasNext, next, reset
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, 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:BasePositionIterator
Get the initialPosition
- Specified by:
initial
in classBasePositionIterator
- Returns:
- the initial position
-
getContinue
Description copied from class:BasePositionIterator
Get the nextPosition
- Specified by:
getContinue
in classBasePositionIterator
- Parameters:
current
- the current position- Returns:
- the next position
- Throws:
NoSuchElementException
- if there is no next position
-
hasContinue
Description copied from class:BasePositionIterator
Check if there is a nextPosition
- Specified by:
hasContinue
in classBasePositionIterator
- Parameters:
current
- the current position- Returns:
- true if there is a next position
-