public abstract class ImmutableList<E>
extends java.util.AbstractCollection<E>
implements java.util.List<E>
AbstractList
with modCount field removed, because the implementations are supposed to be immutable, so
it makes no sense to waste memory on modCount.Constructor and Description |
---|
ImmutableList() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E element) |
boolean |
addAll(int index,
java.util.Collection<? extends E> c) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int index) |
E |
remove(int index) |
E |
set(int index,
E element) |
static <T> ImmutableList<T> |
singleton(T element) |
ImmutableList<E> |
subList(int fromIndex,
int toIndex) |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public java.util.Iterator<E> iterator()
public boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<E>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
public ImmutableList<E> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<E>
public boolean equals(java.lang.Object o)
public int hashCode()
public static <T> ImmutableList<T> singleton(T element)