public abstract class NBTListTag extends NBTBaseTag<NBTListTag>
NBTBaseTag
s of the same type. It is a special
NBTBaseTag
in the sense that its value (returned by NBTBaseTag.get()
)
is itself. The value is determinedModifier and Type | Method and Description |
---|---|
void |
add(NBTBaseTag tag)
Append an element to the end of this list.
|
abstract NBTBaseTag |
get(int pos)
Gets the tag at
pos from the list. |
abstract boolean |
isEmpty()
A shorthand for
size() == 0 . |
abstract NBTBaseTag |
remove(int pos)
Removes the tag at
pos from the list and returns it. |
void |
set(int pos,
NBTBaseTag tag)
Replace the element at index
pos with tag . |
abstract int |
size()
Get the number of tags in this list
|
NBTType<NBTListTag> |
type() |
int |
valueType()
Get the type id of the tags that go inside this list.
|
equals, get, getHandle, hashCode, isCompound, isNumber, toString
public int valueType()
isEmpty()
public NBTType<NBTListTag> type()
type
in class NBTBaseTag<NBTListTag>
public abstract int size()
public void add(NBTBaseTag tag)
tag
- the tag to add to this listjava.lang.ClassCastException
- if the list contains one or more tags and
the tag to add does not share the same type ID.public void set(int pos, NBTBaseTag tag)
pos
with tag
.pos
- the index in the list to settag
- the tag to put into the listjava.lang.IndexOutOfBoundsException
- if the pos
is not an index in
the list.java.lang.ClassCastException
- if the list contains one or more tags and
the tag to add does not share the same type ID.public abstract NBTBaseTag remove(int pos)
pos
from the list and returns it. All of the
following elements are shifted 1 position down to fill the gap.pos
- the index of the tag to removejava.lang.IndexOutOfBoundsException
- if the pos
is not an index in
the list.public abstract boolean isEmpty()
size() == 0
. It checks if this
list contains any elements.size()
== 0)
and false otherwisepublic abstract NBTBaseTag get(int pos)
pos
from the list.pos
- the index of the tag to getpos
java.lang.IndexOutOfBoundsException
- if the pos
is not an index in
the list.