Package net.minecraft.util.collection
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>
-
Field Summary
Fields Modifier and Type Field Description private List<E>
delegate
private E
initialElement
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultedList()
protected
DefaultedList(List<E> delegate, E initialElement)
-
Method Summary
Modifier and Type Method Description void
add(int value, E element)
void
clear()
static <E> DefaultedList<E>
copyOf(E defaultValue, E[] values)
E
get(int index)
static <E> DefaultedList<E>
of()
static <E> DefaultedList<E>
ofSize(int size, E defaultValue)
E
remove(int index)
E
set(int index, E element)
int
size()
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
delegate
-
initialElement
-
-
Constructor Details
-
DefaultedList
protected DefaultedList() -
DefaultedList
-
-
Method Details
-
of
-
ofSize
-
copyOf
-
get
-
set
-
add
-
remove
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
- Overrides:
clear
in classAbstractList<E>
-