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)privateImmutableList(E[] 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)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)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.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:
removeIfin interfacejava.util.Collection<E>
-
replaceAll
public void replaceAll(java.util.function.UnaryOperator<E> operator)
- Specified by:
replaceAllin interfacejava.util.List<E>
-
-