Class ListTag
- All Implemented Interfaces:
Iterable<Tag>, Collection<Tag>, List<Tag>, SequencedCollection<Tag>, CollectionTag, Tag
-
Field Summary
FieldsFields inherited from class AbstractList
modCountFields inherited from interface Tag
ARRAY_HEADER, MAX_DEPTH, OBJECT_HEADER, OBJECT_REFERENCE, STRING_SIZE, TAG_BYTE, TAG_BYTE_ARRAY, TAG_COMPOUND, TAG_DOUBLE, TAG_END, TAG_FLOAT, TAG_INT, TAG_INT_ARRAY, TAG_LIST, TAG_LONG, TAG_LONG_ARRAY, TAG_SHORT, TAG_STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept(StreamTagVisitor visitor) voidaccept(TagVisitor visitor) voidvoidaddAndUnwrap(Tag tag) booleanasList()voidclear()copy()booleanget(int index) getCompound(int index) getCompoundOrEmpty(int index) getDouble(int index) doublegetDoubleOr(int index, double defaultValue) getFloat(int index) floatgetFloatOr(int index, float defaultValue) bytegetId()getInt(int index) Optional<int[]> getIntArray(int index) intgetIntOr(int index, int defaultValue) getList(int index) getListOrEmpty(int index) Optional<long[]> getLongArray(int index) private @Nullable TaggetNullable(int index) getOptional(int index) getShort(int index) shortgetShortOr(int index, short defaultValue) getString(int index) getStringOr(int index, String defaultValue) getType()inthashCode()(package private) bytebooleanisEmpty()private static booleanisWrapper(CompoundTag tag) remove(int index) booleanintsize()intstream()toString()private static TagtryUnwrap(CompoundTag tag) private static CompoundTagwrapElement(Tag tag) private static TagwrapIfNeeded(byte elementType, Tag tag) voidwrite(DataOutput output) Methods inherited from class AbstractList
add, addAll, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArrayMethods inherited from interface Collection
parallelStream, removeIf, toArrayMethods inherited from interface CollectionTag
iteratorMethods inherited from interface List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArrayMethods inherited from interface Tag
acceptAsRoot, asBoolean, asByte, asByteArray, asCompound, asDouble, asFloat, asInt, asIntArray, asLong, asLongArray, asNumber, asShort, asString
-
Field Details
-
WRAPPER_MARKER
- See Also:
-
SELF_SIZE_IN_BYTES
private static final int SELF_SIZE_IN_BYTES- See Also:
-
TYPE
-
list
-
-
Constructor Details
-
ListTag
public ListTag() -
ListTag
public ListTag(int initialCapacity) Neo: create a list tag with the given initial capacity.- Parameters:
initialCapacity- the initial capacity of the list tag
-
ListTag
-
-
Method Details
-
tryUnwrap
-
isWrapper
-
wrapIfNeeded
-
wrapElement
-
write
- Specified by:
writein interfaceTag- Throws:
IOException
-
identifyRawElementType
byte identifyRawElementType() -
addAndUnwrap
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytesin interfaceTag
-
getId
-
getType
-
toString
-
remove
- Specified by:
removein interfaceCollectionTag- Specified by:
removein interfaceList<Tag>- Overrides:
removein classAbstractList<Tag>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Tag>- Specified by:
isEmptyin interfaceCollectionTag- Specified by:
isEmptyin interfaceList<Tag>- Overrides:
isEmptyin classAbstractCollection<Tag>
-
getCompound
-
getCompoundOrEmpty
-
getList
-
getListOrEmpty
-
getShort
-
getShortOr
public short getShortOr(int index, short defaultValue) -
getInt
-
getIntOr
public int getIntOr(int index, int defaultValue) -
getIntArray
-
getLongArray
-
getDouble
-
getDoubleOr
public double getDoubleOr(int index, double defaultValue) -
getFloat
-
getFloatOr
public float getFloatOr(int index, float defaultValue) -
getString
-
getStringOr
-
getNullable
-
getOptional
-
size
public int size()- Specified by:
sizein interfaceCollection<Tag>- Specified by:
sizein interfaceCollectionTag- Specified by:
sizein interfaceList<Tag>- Specified by:
sizein classAbstractCollection<Tag>
-
get
- Specified by:
getin interfaceCollectionTag- Specified by:
getin interfaceList<Tag>- Specified by:
getin classAbstractList<Tag>
-
set
-
add
-
setTag
- Specified by:
setTagin interfaceCollectionTag
-
addTag
- Specified by:
addTagin interfaceCollectionTag
-
copy
-
asList
-
equals
- Specified by:
equalsin interfaceCollection<Tag>- Specified by:
equalsin interfaceList<Tag>- Overrides:
equalsin classAbstractList<Tag>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Tag>- Specified by:
hashCodein interfaceList<Tag>- Overrides:
hashCodein classAbstractList<Tag>
-
stream
- Specified by:
streamin interfaceCollection<Tag>- Specified by:
streamin interfaceCollectionTag
-
compoundStream
-
accept
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Tag>- Specified by:
clearin interfaceCollectionTag- Specified by:
clearin interfaceList<Tag>- Overrides:
clearin classAbstractList<Tag>
-
accept
-