Package net.kyori.adventure.nbt
Interface LongArrayBinaryTag
- All Superinterfaces:
ArrayBinaryTag,BinaryTag,BinaryTagLike,net.kyori.examination.Examinable,Iterable<Long>
public interface LongArrayBinaryTag extends ArrayBinaryTag, Iterable<Long>
A binary tag holding a
long-array value.- Since:
- 4.0.0
-
Method Summary
Modifier and Type Method Description voidforEachLong(@NonNull LongConsumer action)Perform an action for every long in the backing array.longget(int index)Gets the value atindexin this tag.@NonNull PrimitiveIterator.OfLongiterator()static @NonNull LongArrayBinaryTagof(long @NonNull ... value)Creates a binary tag holding along-array value.intsize()Gets the length of the array.@NonNull Spliterator.OfLongspliterator()@NonNull LongStreamstream()Create a stream whose elements are the elements of this array tag.default @NonNull BinaryTagType<LongArrayBinaryTag>type()Gets the tag type.long @NonNull []value()Gets the value.Methods inherited from interface net.kyori.adventure.nbt.BinaryTag
asBinaryTagMethods inherited from interface net.kyori.examination.Examinable
examinableName, examinableProperties, examine
-
Method Details
-
of
Creates a binary tag holding along-array value.- Parameters:
value- the value- Returns:
- a binary tag
- Since:
- 4.0.0
-
type
Description copied from interface:BinaryTagGets the tag type.- Specified by:
typein interfaceArrayBinaryTag- Specified by:
typein interfaceBinaryTag- Returns:
- the tag type
-
value
long @NonNull [] value()Gets the value.The returned array is a copy.
- Returns:
- the value
- Since:
- 4.0.0
-
size
int size()Gets the length of the array.- Returns:
- value size
- Since:
- 4.2.0
-
get
long get(int index)Gets the value atindexin this tag.- Parameters:
index- the index in the array- Returns:
- the long at the index in the array
- Throws:
IndexOutOfBoundsException- if index is < 0 or ≥size()- Since:
- 4.2.0
-
iterator
@NonNull PrimitiveIterator.OfLong iterator()The returned iterator is immutable.
-
spliterator
@NonNull Spliterator.OfLong spliterator()- Specified by:
spliteratorin interfaceIterable<Long>
-
stream
@NonNull LongStream stream()Create a stream whose elements are the elements of this array tag.- Returns:
- a new stream
- Since:
- 4.2.0
-
forEachLong
Perform an action for every long in the backing array.- Parameters:
action- the action to perform- Since:
- 4.2.0
-