Class PartPosIteratorHandlerRoundRobin
java.lang.Object
org.cyclops.integrateddynamics.core.network.PartPosIteratorHandlerRoundRobin
- All Implemented Interfaces:
IPartPosIteratorHandler
An
IPartPosIteratorHandler
that maintains the state of an iterator
and achieves round-robin iteration.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Copy this handler.handleIterator
(Supplier<Iterator<PartPos>> iteratorSupplier, int channel) Given an iteraror constructor, determine the starting position of it.
-
Constructor Details
-
PartPosIteratorHandlerRoundRobin
public PartPosIteratorHandlerRoundRobin(int offset) -
PartPosIteratorHandlerRoundRobin
public PartPosIteratorHandlerRoundRobin()
-
-
Method Details
-
handleIterator
Description copied from interface:IPartPosIteratorHandler
Given an iteraror constructor, determine the starting position of it.- Specified by:
handleIterator
in interfaceIPartPosIteratorHandler
- Parameters:
iteratorSupplier
- A constructor of an iterator ofPartPos
. Each invocation must produce a new iterator.channel
- The channel in which the iterator is being handled.- Returns:
- An iterator, may be ended.
-
clone
Description copied from interface:IPartPosIteratorHandler
Copy this handler. This should be cheap to call, as this can be called multiple times per tick.- Specified by:
clone
in interfaceIPartPosIteratorHandler
- Overrides:
clone
in classObject
- Returns:
- Create a stateful copy of this handler.
-