Interface OpSequence<T>
-
- Type Parameters:
T- The type of element which is to be sequenced
- All Known Implementing Classes:
SequencePlanner.Sequence
public interface OpSequence<T>An OpSequence provides fast access to a set of operations in a specific order.
-
-
Method Summary
Modifier and Type Method Description Tget(long selector)Get the next operation for the given long value.java.util.List<T>getOps()Get the list of individual operations which could be returned byget(long).int[]getSequence()Get the integer sequence that is used to index into the operations.<U> OpSequence<U>transform(java.util.function.Function<T,U> func)Map this OpSequence to another type of OpSequence.
-
-
-
Method Detail
-
get
T get(long selector)
Get the next operation for the given long value. This is simply the offset indicated by the offset sequence array at a modulo position.- Parameters:
selector- the long value that determines the next op- Returns:
- An op of type T
-
getOps
java.util.List<T> getOps()
Get the list of individual operations which could be returned byget(long).- Returns:
- A
Listof T
-
getSequence
int[] getSequence()
Get the integer sequence that is used to index into the operations.- Returns:
- an offset pointer array in int[] form
-
transform
<U> OpSequence<U> transform(java.util.function.Function<T,U> func)
Map this OpSequence to another type of OpSequence.- Type Parameters:
U- The target type of the transformation.- Parameters:
func- The transformation function from this to another type- Returns:
- A new OpSequence of type U
-
-