类 NonNullList<E>

所有已实现的接口:
Iterable<E>, Collection<E>, List<E>, SequencedCollection<E>

public class NonNullList<E> extends AbstractList<E>
  • 字段详细资料

    • list

      private final List<E> list
    • defaultValue

      @Nullable private final E defaultValue
  • 构造器详细资料

    • NonNullList

      protected NonNullList(List<E> p_122777_, @Nullable E p_122778_)
  • 方法详细资料

    • codecOf

      public static <E> com.mojang.serialization.Codec<NonNullList<E>> codecOf(com.mojang.serialization.Codec<E> entryCodec)
      Neo: utility method to construct a Codec for a NonNullList
      类型参数:
      E - the element type
      参数:
      entryCodec - the codec to use for the elements
      返回:
      a codec that encodes as a list, and decodes into NonNullList
    • copyOf

      public static <E> NonNullList<E> copyOf(Collection<? extends E> entries)
      Neo: utility method to construct an immutable NonNullList from a given collection
      类型参数:
      E - the type of the elements in the list
      参数:
      entries - the collection to make a copy of
      返回:
      a new immutable NonNullList
      抛出:
      NullPointerException - if entries is null, or if it contains any nulls
    • create

      public static <E> NonNullList<E> create()
    • createWithCapacity

      public static <E> NonNullList<E> createWithCapacity(int p_182648_)
    • withSize

      public static <E> NonNullList<E> withSize(int p_122781_, E p_122782_)
    • of

      @SafeVarargs public static <E> NonNullList<E> of(E p_122784_, E... p_122785_)
    • get

      @Nonnull public E get(int p_122791_)
      指定者:
      get 在接口中 List<E>
      指定者:
      get 在类中 AbstractList<E>
    • set

      public E set(int p_122795_, E p_122796_)
      指定者:
      set 在接口中 List<E>
      覆盖:
      set 在类中 AbstractList<E>
    • add

      public void add(int p_122787_, E p_122788_)
      指定者:
      add 在接口中 List<E>
      覆盖:
      add 在类中 AbstractList<E>
    • remove

      public E remove(int p_122793_)
      指定者:
      remove 在接口中 List<E>
      覆盖:
      remove 在类中 AbstractList<E>
    • size

      public int size()
      指定者:
      size 在接口中 Collection<E>
      指定者:
      size 在接口中 List<E>
      指定者:
      size 在类中 AbstractCollection<E>
    • clear

      public void clear()
      指定者:
      clear 在接口中 Collection<E>
      指定者:
      clear 在接口中 List<E>
      覆盖:
      clear 在类中 AbstractList<E>