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 class
ImmutableList.SerializationProxy
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Object[]
elements
(package private) static ImmutableList<?>
EMPTY
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
ImmutableList(java.lang.Object... elements)
private
ImmutableList(java.lang.Object[] elements, int fromIndex, int toIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int i, E e)
boolean
add(E e)
boolean
addAll(int index, java.util.Collection<? extends E> collection)
boolean
addAll(java.util.Collection<? extends E> collection)
void
clear()
boolean
contains(java.lang.Object o)
boolean
equals(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super E> action)
E
get(int index)
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)
private void
readObject(java.io.ObjectInputStream ois)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> collection)
boolean
removeIf(java.util.function.Predicate<? super E> filter)
void
replaceAll(java.util.function.UnaryOperator<E> operator)
boolean
retainAll(java.util.Collection<?> collection)
E
set(int i, E e)
int
size()
void
sort(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.Object
writeReplace()
-
-
-
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:
forEach
in 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:
removeIf
in interfacejava.util.Collection<E>
-
replaceAll
public void replaceAll(java.util.function.UnaryOperator<E> operator)
- Specified by:
replaceAll
in interfacejava.util.List<E>
-
sort
public void sort(java.util.Comparator<? super E> comparator)
- Specified by:
sort
in 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()
-
-