Package aQute.lib.unmodifiable
Class ImmutableList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- aQute.lib.unmodifiable.ImmutableList<E>
-
- All Implemented Interfaces:
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
-
-
Field Summary
Fields Modifier and Type Field Description (package private) E[]
elements
(package private) static ImmutableList<?>
EMPTY
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
ImmutableList(E... elements)
private
ImmutableList(E[] 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)
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)
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.List<E>
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] array)
-
-
-
Field Detail
-
EMPTY
static final ImmutableList<?> EMPTY
-
elements
final E[] elements
-
-
Method Detail
-
iterator
public java.util.Iterator<E> iterator()
-
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)
-
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>
-
-