Interface LongArrayBinaryTag

All Superinterfaces:
ArrayBinaryTag, BinaryTag, BinaryTagLike, Iterable<Long>

public sealed interface LongArrayBinaryTag extends ArrayBinaryTag, Iterable<Long>
A binary tag holding a long-array value.
Since:
4.0.0
Since Minecraft:
1.12
  • Method Details

    • longArrayBinaryTag

      static LongArrayBinaryTag longArrayBinaryTag(long... value)
      Creates a binary tag holding a long-array value.
      Parameters:
      value - the value
      Returns:
      a binary tag
      Since:
      4.14.0
    • type

      Description copied from interface: BinaryTag
      Gets the tag type.
      Specified by:
      type in interface ArrayBinaryTag
      Specified by:
      type in interface BinaryTag
      Returns:
      the tag type
    • value

      long[] 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 at index in 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

      The returned iterator is immutable.

      Specified by:
      iterator in interface Iterable<Long>
      Since:
      4.2.0
    • spliterator

      Spliterator.OfLong spliterator()
      Specified by:
      spliterator in interface Iterable<Long>
    • stream

      LongStream stream()
      Create a stream whose elements are the elements of this array tag.
      Returns:
      a new stream
      Since:
      4.2.0
    • forEachLong

      void forEachLong(LongConsumer action)
      Perform an action for every long in the backing array.
      Parameters:
      action - the action to perform
      Since:
      4.2.0