2020import java .util .List ;
2121
2222/// An abstract tag that contains other tags.
23- public sealed abstract class ParentTag <T extends Tag > extends Tag
24- implements Iterable <T >
23+ public sealed abstract class ParentTag <E extends Tag > extends Tag
24+ implements Iterable <E >
2525 permits CompoundTag , ListTag {
2626
27- final List <T > subTags = new ArrayList <>();
27+ final List <E > subTags = new ArrayList <>();
2828
2929 protected ParentTag (String name ) {
3030 super (name );
@@ -61,7 +61,7 @@ public final int size() {
6161 /// Returns the subtag at the given index.
6262 ///
6363 /// @throws IndexOutOfBoundsException if the index is out of bounds.
64- public final T get (int index ) throws IndexOutOfBoundsException {
64+ public final E get (int index ) throws IndexOutOfBoundsException {
6565 return subTags .get (index );
6666 }
6767
@@ -70,7 +70,7 @@ public final T get(int index) throws IndexOutOfBoundsException {
7070 /// If the `tag` is already a child of this tag, does nothing.
7171 ///
7272 /// If the `tag` is already a child of another tag, removes it from old parent and adds it to this tag.
73- public abstract void add (T tag ) throws IllegalArgumentException ;
73+ public abstract void add (E tag ) throws IllegalArgumentException ;
7474
7575 /// Removes the `tag` from this tag.
7676 ///
@@ -80,8 +80,8 @@ public final T get(int index) throws IndexOutOfBoundsException {
8080 // Iterable implementation
8181
8282 @ Override
83- public final Iterator <T > iterator () {
84- Iterator <T > iterator = subTags .iterator ();
83+ public final Iterator <E > iterator () {
84+ Iterator <E > iterator = subTags .iterator ();
8585
8686 // Prevent calling Iterator#remove()
8787 return new Iterator <>() {
@@ -91,7 +91,7 @@ public boolean hasNext() {
9191 }
9292
9393 @ Override
94- public T next () {
94+ public E next () {
9595 return iterator .next ();
9696 }
9797 };
0 commit comments