Package com.landawn.abacus.util
Class ImmutableArray<T>
java.lang.Object
com.landawn.abacus.util.ImmutableArray<T>
-
Method Summary
Modifier and TypeMethodDescriptionasList()
boolean
copy
(int fromIndex, int toIndex) static <T> ImmutableArray
<T> copyOf
(T[] elements) boolean
<E extends Exception>
voidforeach
(Throwables.Consumer<? super T, E> consumer) void
<E extends Exception>
voidforeachIndexed
(Throwables.IntObjConsumer<? super T, E> consumer) get
(int index) int
hashCode()
int
boolean
isEmpty()
iterator()
int
lastIndexOf
(T valueToFind) int
length()
static <T> ImmutableArray
<T> of
(T e1) static <T> ImmutableArray
<T> of
(T e1, T e2) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4, T e5) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4, T e5, T e6) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9) static <T> ImmutableArray
<T> of
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9, T e10) stream()
toString()
static <T> ImmutableArray
<T> wrap
(T[] elements) Deprecated.Methods inherited from interface java.lang.Iterable
spliterator
-
Method Details
-
of
- Type Parameters:
T
-- Parameters:
e1
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-e9
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-e9
-e10
-- Returns:
-
copyOf
- Type Parameters:
T
-- Parameters:
elements
-- Returns:
-
wrap
Deprecated.the ImmutableArray may be modified through the specifiedelements
Wraps the provided array into an ImmutableArray. Changes to the specified array will be reflected in the ImmutableArray- Type Parameters:
T
-- Parameters:
elements
-- Returns:
- an
ImmutableArray
backed by the specifiedelements
-
length
public int length() -
isEmpty
public boolean isEmpty() -
get
- Parameters:
index
-- Returns:
-
indexOf
- Parameters:
valueToFind
-- Returns:
-
lastIndexOf
- Parameters:
valueToFind
-- Returns:
-
contains
- Parameters:
valueToFind
-- Returns:
-
copy
- Parameters:
fromIndex
-toIndex
-- Returns:
- Throws:
IndexOutOfBoundsException
-
asList
-
iterator
-
stream
-
forEach
- Specified by:
forEach
in interfaceIterable<T>
- Parameters:
consumer
-- Throws:
IllegalArgumentException
-
foreach
@Beta public <E extends Exception> void foreach(Throwables.Consumer<? super T, E> consumer) throws IllegalArgumentException, E- Type Parameters:
E
-- Parameters:
consumer
-- Throws:
IllegalArgumentException
E
-
foreachIndexed
@Beta public <E extends Exception> void foreachIndexed(Throwables.IntObjConsumer<? super T, E> consumer) throws IllegalArgumentException, E- Type Parameters:
E
-- Parameters:
consumer
-- Throws:
IllegalArgumentException
E
-
hashCode
public int hashCode() -
equals
-
toString
-
elements