Package com.landawn.abacus.util
Class ImmutableList<E>
java.lang.Object
java.util.AbstractCollection<E>
com.landawn.abacus.util.ImmutableCollection<E>
com.landawn.abacus.util.ImmutableList<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
Immutable
,Iterable<E>
,Collection<E>
,List<E>
- Since:
- 0.8
- Author:
- Haiyang Li
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.boolean
addAll
(int index, Collection<? extends E> newElements) Deprecated.throwsUnsupportedOperationException
static <E> ImmutableList.Builder<E>
builder()
static <E> ImmutableList<E>
copyOf
(Collection<? extends E> c) static <E> ImmutableList<E>
empty()
get
(int index) int
static <T> ImmutableList<T>
just
(T e) int
Last index of.listIterator
(int index) static <E> ImmutableList<E>
of
(E... a) static <T> ImmutableList<T>
of
(T e1) static <T> ImmutableList<T>
of
(T e1, T e2) static <T> ImmutableList<T>
of
(T e1, T e2, T e3) static <T> ImmutableList<T>
of
(T e1, T e2, T e3, T e4) static <T> ImmutableList<T>
of
(T e1, T e2, T e3, T e4, T e5) static <T> ImmutableList<T>
of
(T e1, T e2, T e3, T e4, T e5, T e6) static <T> ImmutableList<T>
of
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) remove
(int index) Deprecated.throwsUnsupportedOperationException
void
replaceAll
(UnaryOperator<E> operator) Deprecated.throwsUnsupportedOperationException
Deprecated.throwsUnsupportedOperationException
void
sort
(Comparator<? super E> c) Deprecated.throwsUnsupportedOperationException
subList
(int fromIndex, int toIndex) static <E> ImmutableCollection<E>
wrap
(Collection<? extends E> c) Deprecated.throwsUnsupportedOperationException
static <E> ImmutableList<E>
Deprecated.the ImmutableList may be modified through the specifiedlist
Methods inherited from class com.landawn.abacus.util.ImmutableCollection
add, addAll, clear, contains, equals, hashCode, iterator, remove, removeAll, removeIf, retainAll, size, toArray, toArray, toString
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
empty
- Type Parameters:
E
-- Returns:
-
just
- Type Parameters:
T
-- Parameters:
e
-- Returns:
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
- Type Parameters:
E
-- Parameters:
a
-- Returns:
-
copyOf
- Type Parameters:
E
-- Parameters:
c
-- Returns:
-
wrap
Deprecated.the ImmutableList may be modified through the specifiedlist
- Type Parameters:
E
-- Parameters:
list
-- Returns:
- an
ImmutableList
backed by the specifiedlist
-
wrap
@Deprecated public static <E> ImmutableCollection<E> wrap(Collection<? extends E> c) throws UnsupportedOperationException Deprecated.throwsUnsupportedOperationException
- Type Parameters:
E
-- Parameters:
c
-- Returns:
- Throws:
UnsupportedOperationException
-
get
-
indexOf
-
lastIndexOf
Last index of.- Specified by:
lastIndexOf
in interfaceList<E>
- Parameters:
o
-- Returns:
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
- Parameters:
index
-- Returns:
-
subList
-
addAll
@Deprecated public boolean addAll(int index, Collection<? extends E> newElements) throws UnsupportedOperationException Deprecated.throwsUnsupportedOperationException
Adds the all.- Specified by:
addAll
in interfaceList<E>
- Parameters:
index
-newElements
-- Returns:
- Throws:
UnsupportedOperationException
-
set
Deprecated.throwsUnsupportedOperationException
- Specified by:
set
in interfaceList<E>
- Parameters:
index
-element
-- Returns:
- Throws:
UnsupportedOperationException
-
add
Deprecated.throwsUnsupportedOperationException
- Specified by:
add
in interfaceList<E>
- Parameters:
index
-element
-- Throws:
UnsupportedOperationException
-
remove
Deprecated.throwsUnsupportedOperationException
- Specified by:
remove
in interfaceList<E>
- Parameters:
index
-- Returns:
- Throws:
UnsupportedOperationException
-
replaceAll
Deprecated.throwsUnsupportedOperationException
- Specified by:
replaceAll
in interfaceList<E>
- Parameters:
operator
-- Throws:
UnsupportedOperationException
-
sort
Deprecated.throwsUnsupportedOperationException
- Specified by:
sort
in interfaceList<E>
- Parameters:
c
-- Throws:
UnsupportedOperationException
-
builder
-
UnsupportedOperationException