java.lang.Object
at.syntaxerror.syntaxnbt.tag.Tag<T>
at.syntaxerror.syntaxnbt.tag.TagArray<N,T>
- Type Parameters:
T- type of the number stored in this arrayN- type of the array stored in this tag
- Direct Known Subclasses:
TagByteArray,TagIntArray,TagLongArray
- Author:
- SyntaxError404
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInserts an element at the specified position in the arrayAdd an element to the arrayInserts an element at the specified position in the arrayAdd an element to the arrayprotected voidcheckBounds(int index) Checks if the index lies within the bounds of the list (forset(int, Number))protected voidcheckBoundsExclusive(int index) Checks if the index lies within the bounds of the list (foradd(int, Number))clear()Removes all of the elements from this arrayabstract Nget(int index) Returns the element at the specified position in this arrayReturns the type of the arraygetTag(int index) Returns the tag at the specified position in this array as aTagNumberremove(int index) Removes the element at the specified position in this arrayReplaces an element at the specified position in the arrayReplaces an element at the specified position in the arrayintsize()Returns the number of elements in this array
-
Constructor Details
-
TagArray
Constructs an array of the specified type- Parameters:
type- type of elements in this arrayarray- array of elements
-
-
Method Details
-
checkBounds
protected void checkBounds(int index) Checks if the index lies within the bounds of the list (forset(int, Number))- Parameters:
index- the index
-
checkBoundsExclusive
protected void checkBoundsExclusive(int index) Checks if the index lies within the bounds of the list (foradd(int, Number))- Parameters:
index- the index
-
set
Replaces an element at the specified position in the array- Parameters:
index- index of the element to replacevalue- the element to be stored at the specified position- Returns:
- this array
-
setTag
Replaces an element at the specified position in the array- Parameters:
index- index of the element to replacevalue- the element to be stored at the specified position- Returns:
- this array
-
add
Add an element to the array- Parameters:
value- the element to be added- Returns:
- this array
-
addTag
Add an element to the array- Parameters:
value- the element to be added- Returns:
- this array
-
add
Inserts an element at the specified position in the array- Parameters:
index- index at which the specified element is to be insertedvalue- element to be added- Returns:
- this array
-
addTag
Inserts an element at the specified position in the array- Parameters:
index- index at which the specified element is to be insertedvalue- element to be added- Returns:
- this array
-
get
Returns the element at the specified position in this array- Parameters:
index- index of the element to be returned- Returns:
- the element at the specified position in this array
-
getTag
Returns the tag at the specified position in this array as aTagNumber- Parameters:
index- index of the element to be returned- Returns:
- the element at the specified position in this array
-
size
public int size()Returns the number of elements in this array- Returns:
- the number of elements in this array
-
remove
Removes the element at the specified position in this array- Parameters:
index- index of the element to be removed- Returns:
- this array
-
clear
Removes all of the elements from this array- Returns:
- this array
-
getArrayType
Returns the type of the array- Returns:
- the type of the array
-