Package aQute.bnd.unmodifiable
Class ImmutableList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- aQute.bnd.unmodifiable.ImmutableList<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
final class ImmutableList<E> extends java.util.AbstractList<E> implements java.util.List<E>, java.util.RandomAccess, java.io.Serializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classImmutableList.SerializationProxy
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Object[]elements(package private) static ImmutableList<?>EMPTYprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description (package private)ImmutableList(java.lang.Object... elements)privateImmutableList(java.lang.Object[] elements, int fromIndex, int toIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int i, E e)booleanadd(E e)booleanaddAll(int index, java.util.Collection<? extends E> collection)booleanaddAll(java.util.Collection<? extends E> collection)voidclear()booleancontains(java.lang.Object o)booleanequals(java.lang.Object o)voidforEach(java.util.function.Consumer<? super E> action)Eget(int index)inthashCode()intindexOf(java.lang.Object o)java.util.Iterator<E>iterator()intlastIndexOf(java.lang.Object o)java.util.ListIterator<E>listIterator()java.util.ListIterator<E>listIterator(int index)private voidreadObject(java.io.ObjectInputStream ois)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> collection)booleanremoveIf(java.util.function.Predicate<? super E> filter)voidreplaceAll(java.util.function.UnaryOperator<E> operator)booleanretainAll(java.util.Collection<?> collection)Eset(int i, E e)intsize()voidsort(java.util.Comparator<? super E> comparator)java.util.Spliterator<E>spliterator()java.util.List<E>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] array)private java.lang.ObjectwriteReplace()
-
-
-
Field Detail
-
EMPTY
static final ImmutableList<?> EMPTY
-
elements
final java.lang.Object[] elements
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
iterator
public java.util.Iterator<E> iterator()
-
spliterator
public java.util.Spliterator<E> spliterator()
-
listIterator
public java.util.ListIterator<E> listIterator()
-
listIterator
public java.util.ListIterator<E> listIterator(int index)
-
size
public int size()
-
get
public E get(int index)
-
subList
public java.util.List<E> subList(int fromIndex, int toIndex)
-
contains
public boolean contains(java.lang.Object o)
-
indexOf
public int indexOf(java.lang.Object o)
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
forEach
public void forEach(java.util.function.Consumer<? super E> action)
- Specified by:
forEachin interfacejava.lang.Iterable<E>
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
add
public boolean add(E e)
-
add
public void add(int i, E e)
-
remove
public boolean remove(java.lang.Object o)
-
addAll
public boolean addAll(java.util.Collection<? extends E> collection)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends E> collection)
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
-
clear
public void clear()
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
- Specified by:
removeIfin interfacejava.util.Collection<E>
-
replaceAll
public void replaceAll(java.util.function.UnaryOperator<E> operator)
- Specified by:
replaceAllin interfacejava.util.List<E>
-
sort
public void sort(java.util.Comparator<? super E> comparator)
- Specified by:
sortin interfacejava.util.List<E>
-
readObject
private void readObject(java.io.ObjectInputStream ois) throws java.io.InvalidObjectException- Throws:
java.io.InvalidObjectException
-
writeReplace
private java.lang.Object writeReplace()
-
-