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>

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

    • delegate

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

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

    • DefaultedList

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

    • of

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

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

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

      @SafeVarargs public static <E> DefaultedList<E> copyOf(E defaultValue, E[] values)
      Mappings:
      Namespace Name Mixin selector
      official a Lgt;a(Ljava/lang/Object;[Ljava/lang/Object;)Lgt;
      intermediary method_10212 Lnet/minecraft/class_2371;method_10212(Ljava/lang/Object;[Ljava/lang/Object;)Lnet/minecraft/class_2371;
      named copyOf Lnet/minecraft/util/collection/DefaultedList;copyOf(Ljava/lang/Object;[Ljava/lang/Object;)Lnet/minecraft/util/collection/DefaultedList;
    • 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
      official get Lgt;get(I)Ljava/lang/Object;
      intermediary get Lnet/minecraft/class_2371;get(I)Ljava/lang/Object;
      named get Lnet/minecraft/util/collection/DefaultedList;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
      official set Lgt;set(ILjava/lang/Object;)Ljava/lang/Object;
      intermediary set Lnet/minecraft/class_2371;set(ILjava/lang/Object;)Ljava/lang/Object;
      named set Lnet/minecraft/util/collection/DefaultedList;set(ILjava/lang/Object;)Ljava/lang/Object;
    • add

      public void add(int value, E element)
      Specified by:
      add in interface List<E>
      Overrides:
      add in class AbstractList<E>
      Mappings:
      Namespace Name Mixin selector
      official add Lgt;add(ILjava/lang/Object;)V
      intermediary add Lnet/minecraft/class_2371;add(ILjava/lang/Object;)V
      named add Lnet/minecraft/util/collection/DefaultedList;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
      official remove Lgt;remove(I)Ljava/lang/Object;
      intermediary remove Lnet/minecraft/class_2371;remove(I)Ljava/lang/Object;
      named remove Lnet/minecraft/util/collection/DefaultedList;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>