Class DefaultedList<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
net.minecraft.util.collection.DefaultedList<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>

public class DefaultedList<E> extends AbstractList<E>
Mappings:
Namespace Name
named net/minecraft/util/collection/DefaultedList
intermediary net/minecraft/class_2371
official jv
  • Field Details

    • delegate

      private final List<E> delegate
      Mappings:
      Namespace Name Mixin selector
      named delegate Lnet/minecraft/util/collection/DefaultedList;delegate:Ljava/util/List;
      intermediary field_11115 Lnet/minecraft/class_2371;field_11115:Ljava/util/List;
      official a Ljv;a:Ljava/util/List;
    • initialElement

      @Nullable private final E initialElement
      Mappings:
      Namespace Name Mixin selector
      named initialElement Lnet/minecraft/util/collection/DefaultedList;initialElement:Ljava/lang/Object;
      intermediary field_11116 Lnet/minecraft/class_2371;field_11116:Ljava/lang/Object;
      official b Ljv;b:Ljava/lang/Object;
  • Constructor Details

    • DefaultedList

      protected DefaultedList(List<E> delegate, @Nullable E initialElement)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/collection/DefaultedList;<init>(Ljava/util/List;Ljava/lang/Object;)V
      intermediary <init> Lnet/minecraft/class_2371;<init>(Ljava/util/List;Ljava/lang/Object;)V
      official <init> Ljv;<init>(Ljava/util/List;Ljava/lang/Object;)V
  • Method Details

    • of

      public static <E> DefaultedList<E> of()
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/util/collection/DefaultedList;of()Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_10211 Lnet/minecraft/class_2371;method_10211()Lnet/minecraft/class_2371;
      official a Ljv;a()Ljv;
    • ofSize

      public static <E> DefaultedList<E> ofSize(int size)
      Mappings:
      Namespace Name Mixin selector
      named ofSize Lnet/minecraft/util/collection/DefaultedList;ofSize(I)Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_37434 Lnet/minecraft/class_2371;method_37434(I)Lnet/minecraft/class_2371;
      official a Ljv;a(I)Ljv;
    • ofSize

      public static <E> DefaultedList<E> ofSize(int size, E defaultValue)
      Mappings:
      Namespace Name Mixin selector
      named ofSize Lnet/minecraft/util/collection/DefaultedList;ofSize(ILjava/lang/Object;)Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_10213 Lnet/minecraft/class_2371;method_10213(ILjava/lang/Object;)Lnet/minecraft/class_2371;
      official a Ljv;a(ILjava/lang/Object;)Ljv;
    • copyOf

      @SafeVarargs public static <E> DefaultedList<E> copyOf(E defaultValue, E[] values)
      Mappings:
      Namespace Name Mixin selector
      named copyOf Lnet/minecraft/util/collection/DefaultedList;copyOf(Ljava/lang/Object;[Ljava/lang/Object;)Lnet/minecraft/util/collection/DefaultedList;
      intermediary method_10212 Lnet/minecraft/class_2371;method_10212(Ljava/lang/Object;[Ljava/lang/Object;)Lnet/minecraft/class_2371;
      official a Ljv;a(Ljava/lang/Object;[Ljava/lang/Object;)Ljv;
    • get

      @NotNull public E get(int index)
      Specified by:
      get in interface List<E>
      Specified by:
      get in class AbstractList<E>
      Mappings:
      Namespace Name Mixin selector
      named get Lnet/minecraft/util/collection/DefaultedList;get(I)Ljava/lang/Object;
      intermediary get Lnet/minecraft/class_2371;get(I)Ljava/lang/Object;
      official get Ljv;get(I)Ljava/lang/Object;
    • set

      public E set(int index, E element)
      Specified by:
      set in interface List<E>
      Overrides:
      set in class AbstractList<E>
      Mappings:
      Namespace Name Mixin selector
      named set Lnet/minecraft/util/collection/DefaultedList;set(ILjava/lang/Object;)Ljava/lang/Object;
      intermediary set Lnet/minecraft/class_2371;set(ILjava/lang/Object;)Ljava/lang/Object;
      official set Ljv;set(ILjava/lang/Object;)Ljava/lang/Object;
    • add

      public void add(int index, E element)
      Specified by:
      add in interface List<E>
      Overrides:
      add in class AbstractList<E>
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/collection/DefaultedList;add(ILjava/lang/Object;)V
      intermediary add Lnet/minecraft/class_2371;add(ILjava/lang/Object;)V
      official add Ljv;add(ILjava/lang/Object;)V
    • remove

      public E remove(int index)
      Specified by:
      remove in interface List<E>
      Overrides:
      remove in class AbstractList<E>
      Mappings:
      Namespace Name Mixin selector
      named remove Lnet/minecraft/util/collection/DefaultedList;remove(I)Ljava/lang/Object;
      intermediary remove Lnet/minecraft/class_2371;remove(I)Ljava/lang/Object;
      official remove Ljv;remove(I)Ljava/lang/Object;
    • size

      public int size()
      Specified by:
      size in interface Collection<E>
      Specified by:
      size in interface List<E>
      Specified by:
      size in class AbstractCollection<E>
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<E>
      Specified by:
      clear in interface List<E>
      Overrides:
      clear in class AbstractList<E>