public class InstructionCollection<T extends Instruction> extends InstructionSlot<T> implements net.covers1624.quack.collection.FastStream<T>
InstructionSlot capable of holding multiple instructions.
Created by covers1624 on 22/9/21.
| Modifier and Type | Class and Description |
|---|---|
protected class |
InstructionCollection.CollectionSlot |
net.covers1624.quack.collection.FastStream.Concatenated<T>, net.covers1624.quack.collection.FastStream.ConcatenatedN<T>, net.covers1624.quack.collection.FastStream.Distinct<T>, net.covers1624.quack.collection.FastStream.Filtered<T>, net.covers1624.quack.collection.FastStream.FlatMapped<T,R>, net.covers1624.quack.collection.FastStream.Group<K,V>, net.covers1624.quack.collection.FastStream.Grouped<T,K,V>, net.covers1624.quack.collection.FastStream.Internal, net.covers1624.quack.collection.FastStream.Mapped<T,R>, net.covers1624.quack.collection.FastStream.OfN<T>, net.covers1624.quack.collection.FastStream.OfSingle<T>, net.covers1624.quack.collection.FastStream.Peeked<T>, net.covers1624.quack.collection.FastStream.Reversed<T>, net.covers1624.quack.collection.FastStream.Sliced<T>, net.covers1624.quack.collection.FastStream.Sorted<T>, net.covers1624.quack.collection.FastStream.TypeCheck<T,S>, net.covers1624.quack.collection.FastStream.Wrapped<T>, net.covers1624.quack.collection.FastStream.WrappedSpl<T>| Constructor and Description |
|---|
InstructionCollection(Instruction parent)
Create a new
InstructionCollection. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T value)
Add an
Instruction to the end of this collection. |
protected void |
add(T value,
InstructionCollection.CollectionSlot newSlot) |
void |
addAll(java.lang.Iterable<? extends T> values)
Adds multiple
Instructions to the end of this collection. |
void |
addAllFirst(java.lang.Iterable<? extends T> values) |
void |
addFirst(T value)
Adds an instruction to the start of this collection.
|
protected void |
checkInvariant() |
void |
clear()
Removes all elements from this collection.
|
int |
count() |
T |
getValueOrNull()
Return the value stored inside the slot.
|
boolean |
isEmpty() |
@NotNull java.util.Iterator<T> |
iterator() |
T |
secondToLastOrDefault()
Returns the second to last
Instruction in this
collection or null. |
void |
set(Instruction value)
Set the value in this slot.
|
int |
size()
Get the number of elements stored in this collection.
|
getclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitallMatch, anyMatch, concat, concat, concatMany, distinct, doubleSum, empty, filter, filterNot, findFirst, findLast, first, firstOrDefault, firstOrDefault, flatMap, fold, fold, groupBy, groupBy, infer, intSum, join, knownLength, knownLength, last, lastOrDefault, lastOrDefault, limit, longSum, map, maxBy, maxByOrDefault, maxByOrDefault, noneMatch, of, of, of, of, of, of, of, ofNullable, only, onlyOrDefault, onlyOrDefault, peek, reversed, skip, sorted, sorted, toArray, toArray, toImmutableList, toImmutableList, toImmutableMap, toImmutableMap, toImmutableSet, toImmutableSet, toLinkedHashMap, toLinkedHashMap, toLinkedHashSet, toLinkedHashSet, toLinkedList, toLinkedList, toList, toList, toMap, toMap, toMap, toMap, toSet, toSetpublic InstructionCollection(Instruction parent)
InstructionCollection.parent - The parent owning instruction.public void addFirst(T value)
value - The value.public void add(T value)
Instruction to the end of this collection.value - The Instruction.public void addAllFirst(java.lang.Iterable<? extends T> values)
public void addAll(java.lang.Iterable<? extends T> values)
Instructions to the end of this collection.values - The Instructions.@Nullable public T secondToLastOrDefault()
Instruction in this
collection or null.Instruction.public int size()
public void clear()
protected void add(T value, InstructionCollection.CollectionSlot newSlot)
public T getValueOrNull()
InstructionSlotgetValueOrNull in class InstructionSlot<T extends Instruction>nullprotected void checkInvariant()
checkInvariant in class InstructionSlot<T extends Instruction>public void set(Instruction value)
InstructionSlotset in class InstructionSlot<T extends Instruction>value - The value.public int count()
count in interface net.covers1624.quack.collection.FastStream<T extends Instruction>public boolean isEmpty()
isEmpty in interface net.covers1624.quack.collection.FastStream<T extends Instruction>@NotNull public @NotNull java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends Instruction>