Package net.kyori.adventure.nbt
Interface IntArrayBinaryTag
- All Superinterfaces:
ArrayBinaryTag
,BinaryTag
,net.kyori.examination.Examinable
,Iterable<Integer>
public interface IntArrayBinaryTag extends ArrayBinaryTag, Iterable<Integer>
A binary tag holding an
int
-array value.- Since:
- 4.0.0
-
Method Summary
Modifier and Type Method Description void
forEachInt(@NonNull IntConsumer action)
Perform an action for every int in the backing array.int
get(int index)
Gets the value atindex
in this tag.@NonNull PrimitiveIterator.OfInt
iterator()
static @NonNull IntArrayBinaryTag
of(int @NonNull ... value)
Creates a binary tag holding anint
-array value.int
size()
Get the length of the array.@NonNull Spliterator.OfInt
spliterator()
@NonNull IntStream
stream()
Create a stream whose elements are the elements of this array tag.default @NonNull BinaryTagType<IntArrayBinaryTag>
type()
Gets the tag type.int @NonNull []
value()
Gets the value.
-
Method Details
-
of
Creates a binary tag holding anint
-array value.- Parameters:
value
- the value- Returns:
- a binary tag
- Since:
- 4.0.0
-
type
Description copied from interface:BinaryTag
Gets the tag type.- Specified by:
type
in interfaceArrayBinaryTag
- Specified by:
type
in interfaceBinaryTag
- Returns:
- the tag type
-
value
int @NonNull [] value()Gets the value.The returned array is a copy.
- Returns:
- the value
- Since:
- 4.0.0
-
size
int size()Get the length of the array.- Returns:
- value size
- Since:
- 4.2.0
-
get
int get(int index)Gets the value atindex
in this tag.- Parameters:
index
- the index in the array- Returns:
- the int at the index in the array
- Throws:
IndexOutOfBoundsException
- if idx < 0 or ≥size()
- Since:
- 4.2.0
-
iterator
@NonNull PrimitiveIterator.OfInt iterator()The returned iterator is immutable.
-
spliterator
@NonNull Spliterator.OfInt spliterator()- Specified by:
spliterator
in interfaceIterable<Integer>
-
stream
@NonNull IntStream stream()Create a stream whose elements are the elements of this array tag.- Returns:
- a new stream
- Since:
- 4.2.0
-
forEachInt
Perform an action for every int in the backing array.- Parameters:
action
- the action to perform- Since:
- 4.2.0
-