| Constructor and Description |
|---|
ListTag()
Create an empty list tag.
|
ListTag(java.util.List<T> list)
Create a list tag from a
List. |
ListTag(NbtType type)
Create a list tag with the given type.
|
ListTag(NbtType type,
java.util.List<T> value)
Create a list tag from a type and a
List. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T tag)
Add a tag to the list.
|
boolean |
canAdd(INbtTag tag)
Check if the tag can be added to the list.
|
boolean |
canAdd(NbtType type)
Check if the type can be added to the list.
|
INbtTag |
copy() |
boolean |
equals(java.lang.Object o) |
T |
get(int index)
Get a tag from the list.
|
NbtType |
getNbtType() |
NbtType |
getType() |
java.util.List<T> |
getValue() |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
void |
read(java.io.DataInput in,
NbtReadTracker readTracker)
Read the tag value from a given
DataInput. |
void |
remove(T tag)
Remove a tag from the list.
|
void |
set(int index,
T tag)
Set a tag in the list.
|
void |
setValue(java.util.List<T> value)
Set the list value.
|
int |
size() |
java.lang.String |
toString() |
boolean |
trim()
Trim the list by removing empty tags.
|
void |
write(java.io.DataOutput out)
Write the tag value to a given
DataOutput. |
public ListTag()
public ListTag(NbtType type)
type - The typepublic ListTag(java.util.List<T> list)
List.list - The listjava.lang.IllegalArgumentException - If the list contains mixed typespublic NbtType getType()
public java.util.List<T> getValue()
public void setValue(java.util.List<T> value)
value - The new valuepublic T get(int index)
index - The indexpublic void add(T tag)
tag - The tagjava.lang.IllegalArgumentException - If the tag is not of the same type as the listpublic void set(int index,
T tag)
index - The indextag - The tagjava.lang.IndexOutOfBoundsException - If the index is out of boundsjava.lang.IllegalArgumentException - If the tag is not of the same type as the listpublic void remove(T tag)
tag - The tagjava.lang.IllegalArgumentException - If the tag is not of the same type as the listpublic boolean canAdd(INbtTag tag)
tag - The tagpublic boolean canAdd(NbtType type)
type - The typepublic boolean trim()
public int size()
public boolean isEmpty()
public NbtType getNbtType()
getNbtType in interface INbtTagpublic void read(java.io.DataInput in,
NbtReadTracker readTracker)
throws java.io.IOException
INbtTagDataInput.public void write(java.io.DataOutput out)
throws java.io.IOException
INbtTagDataOutput.public INbtTag copy()
public java.util.Iterator<T> iterator()
public boolean equals(java.lang.Object o)
public int hashCode()