Package org.mattrick.enbeet
Class NBTList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Object>,Collection<Object>,List<Object>,RandomAccess
Represents an NBT ListTag, which contains one type of NBT Tag.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int index)Get the Object at the given index.<T> Optional<T>Get the Object of the given type at the given index.getByte(int index)Get the Byte at the given index.Optional<byte[]>getByteArray(int index)Get the byte[] at the given index.getCompound(int index)Get the NBTCompound at the given index.getDouble(int index)Get the Double at the given index.getFloat(int index)Get the Float at the given index.getInt(int index)Get the Integer at the given index.Optional<int[]>getIntArray(int index)Get the int[] at the given index.getList(int index)Get the NBTList at the given index.getLong(int index)Get the Long at the given index.Optional<long[]>getLongArray(int index)Get the long[] at the given index.getShort(int index)Get the Short at the given index.getString(int index)Get the String at the given index.getType()Get the type of this NBTList.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Constructor Details
-
NBTList
Create a new NBTList of the given type.- Parameters:
type- The type of the NBTList.
-
-
Method Details
-
getType
Get the type of this NBTList.- Returns:
- The type of this NBTList.
-
get
Get the Object at the given index. -
get
Get the Object of the given type at the given index.- Type Parameters:
T- The type of the object to get.- Parameters:
type- The type of the object.index- The index to get.- Returns:
- An Optional, containing an Object of type T at the index. Will be empty if the type doesn't match.
-
getByte
Get the Byte at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the Byte at the index. Will be empty if the type doesn't match.
-
getShort
Get the Short at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the Short at the index. Will be empty if the type doesn't match.
-
getInt
Get the Integer at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the Integer at the index. Will be empty if the type doesn't match.
-
getLong
Get the Long at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the Long at the index. Will be empty if the type doesn't match.
-
getFloat
Get the Float at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the Float at the index. Will be empty if the type doesn't match.
-
getDouble
Get the Double at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the Double at the index. Will be empty if the type doesn't match.
-
getByteArray
Get the byte[] at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the byte[] at the index. Will be empty if the type doesn't match.
-
getString
Get the String at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the String at the index. Will be empty if the type doesn't match.
-
getList
Get the NBTList at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the NBTList at the index. Will be empty if the type doesn't match.
-
getCompound
Get the NBTCompound at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the NBTCompound at the index. Will be empty if the type doesn't match.
-
getIntArray
Get the int[] at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the int[] at the index. Will be empty if the type doesn't match.
-
getLongArray
Get the long[] at the given index.- Parameters:
index- The index to get.- Returns:
- An Optional, containing the long[] at the index. Will be empty if the type doesn't match.
-