Package com.viaversion.nbt.tag
Class LongArrayTag
java.lang.Object
com.viaversion.nbt.tag.LongArrayTag
- All Implemented Interfaces:
NumberArrayTag,Tag
A tag containing a long array.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the raw string representation of the value of this tag.copy()Returns a copy of this tag.booleanlongget(int index) Gets a value in this tag's array.intgetTagId()Returns the NBT tag id of this tag type, used in I/O.long[]getValue()Returns the value of this tag.inthashCode()intlength()Gets the length of this tag's array.static LongArrayTagread(DataInput in, TagLimiter tagLimiter) voidset(int index, long value) Sets a value in this tag's array.voidsetValue(long[] value) Sets the value of this tag.Creates a new list tag from this tag.toString()voidwrite(DataOutput out) Writes this tag to an output stream.
-
Field Details
-
ID
public static final int ID- See Also:
-
-
Constructor Details
-
LongArrayTag
public LongArrayTag()Creates a tag. -
LongArrayTag
public LongArrayTag(long[] value) Creates a tag.- Parameters:
value- The value of the tag.
-
-
Method Details
-
read
- Throws:
IOException
-
getValue
public long[] getValue()Description copied from interface:TagReturns the value of this tag. -
asRawString
Description copied from interface:TagReturns the raw string representation of the value of this tag. For SNBT, useSNBT.serialize(Tag).- Specified by:
asRawStringin interfaceTag- Returns:
- raw string representation of the value of this tag
-
setValue
public void setValue(long[] value) Sets the value of this tag.- Parameters:
value- New value of this tag.
-
get
public long get(int index) Gets a value in this tag's array.- Parameters:
index- Index of the value.- Returns:
- The value at the given index.
-
set
public void set(int index, long value) Sets a value in this tag's array.- Parameters:
index- Index of the value.value- Value to set.
-
length
public int length()Description copied from interface:NumberArrayTagGets the length of this tag's array.- Specified by:
lengthin interfaceNumberArrayTag- Returns:
- array length
-
toListTag
Description copied from interface:NumberArrayTagCreates a new list tag from this tag.- Specified by:
toListTagin interfaceNumberArrayTag- Returns:
- a new list tag
-
write
Description copied from interface:TagWrites this tag to an output stream.- Specified by:
writein interfaceTag- Parameters:
out- data output to write to- Throws:
IOException- if an I/O error occurs
-
equals
-
hashCode
public int hashCode() -
copy
Description copied from interface:TagReturns a copy of this tag.- Specified by:
copyin interfaceNumberArrayTag- Specified by:
copyin interfaceTag- Returns:
- a copy of this tag
-
getTagId
public int getTagId()Description copied from interface:TagReturns the NBT tag id of this tag type, used in I/O. -
toString
-