ArrayCompanion<T> extension
- on
-
- Array<
T>
- Array<
Properties
-
indices
→ Iterable<
int> -
Available on Array<
T> , provided by the ArrayCompanion extensionno setter - lastIndex → int
-
Available on Array<
T> , provided by the ArrayCompanion extensionno setter - size → int
-
Available on Array<
T> , provided by the ArrayCompanion extensionno setter
Methods
-
all(
bool predicate(T)) → bool -
Available on Array<
ReturnsT> , provided by the ArrayCompanion extensiontrueif all elements match the givenpredicate. -
chunked(
int size) → List< List< T> > -
Available on Array<
T> , provided by the ArrayCompanion extension -
containsAll(
Iterable< T> elements) → Boolean -
Available on Array<
T> , provided by the ArrayCompanion extension -
contentToString(
) → String -
Available on Array<
Returns a string representation of the contents of the specified array as if it is List.T> , provided by the ArrayCompanion extension -
count(
bool predicate(T)?) → int -
Available on Array<
Returns the number of elements matching the givenT> , provided by the ArrayCompanion extensionpredicate. -
distinct(
) → Iterable< T> -
Available on Array<
Returns a list containing only distinct elements from the given array.T> , provided by the ArrayCompanion extension -
drop(
int n) → Iterable< T> -
Available on Array<
Returns a list containing all elements except firstT> , provided by the ArrayCompanion extensionnelements. -
dropLast(
int n) → Iterable< T> -
Available on Array<
Returns a list containing all elements except lastT> , provided by the ArrayCompanion extensionnelements. -
filter(
bool predicate(T)) → Iterable< T> -
Available on Array<
Returns a list containing only elements matching the given predicate.T> , provided by the ArrayCompanion extension -
filterIndexed(
bool predicate(int, T)) → Iterable< T> -
Available on Array<
Returns a list containing only elements matching the given predicate.T> , provided by the ArrayCompanion extension -
filterNot(
bool predicate(T it)) → Iterable< T> -
Available on Array<
Returns a list containing only elements matching the given predicate.T> , provided by the ArrayCompanion extension -
find(
bool predicate(T? it)) → T? -
Available on Array<
Returns the first element matching the given predicate, or null if no such element was found.T> , provided by the ArrayCompanion extension -
findLast(
bool predicate(T? it)) → T? -
Available on Array<
Returns the last element matching the given predicate, or null if no such element was found.T> , provided by the ArrayCompanion extension -
get(
int index) → T -
Available on Array<
T> , provided by the ArrayCompanion extension -
getOrElse(
int index, T defaultValue(int)) → T -
Available on Array<
Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.T> , provided by the ArrayCompanion extension -
getOrNull(
int index, T defaultValue(int)) → T? -
Available on Array<
Returns an element at the given index or the result of calling the defaultValue function if the index is out of bounds of this array.T> , provided by the ArrayCompanion extension -
groupBy<
K, V> (K keySelector(Any?), V valueTransform(Any?)?) → Map< K, V> -
Available on Array<
T> , provided by the ArrayCompanion extension -
indexOfFirst(
bool predicate(T?)) → Int -
Available on Array<
Returns index of the first element matching the given predicate, or -1 if the array does not contain such element.T> , provided by the ArrayCompanion extension -
intersect(
Iterable< T> other) → Set<T> -
Available on Array<
Returns a set containing all elements that are contained by both this array and the specified collection.T> , provided by the ArrayCompanion extension -
joinToString(
{String separator = ', ', String prefix = '', String postfix = '', Int limit = -1, String truncated = '...', String transform(T)?}) → String -
Available on Array<
T> , provided by the ArrayCompanion extension -
minus(
Iterable< T> elements) → List<T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
minusElement(
T element) → List< T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
none(
{bool predicate(T)?}) → bool -
Available on Array<
ReturnsT> , provided by the ArrayCompanion extensiontrueif no elements match the givenpredicate. -
onEach(
void action(T)) → Iterable< T> -
Available on Array<
Performs the given action on each element and returns the collection itself afterwards.T> , provided by the ArrayCompanion extension -
partition(
bool predicate(T)) → (List< T> , List<T> ) -
Available on Array<
T> , provided by the ArrayCompanion extension -
plus(
Iterable< T> elements) → List<T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
plusElement(
T element) → List< T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
requireNoNulls(
) → Iterable< T?> -
Available on Array<
T> , provided by the ArrayCompanion extension -
set(
int index, T value) → void -
Available on Array<
T> , provided by the ArrayCompanion extension -
shuffled(
Random random) → List< T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
singleOrNull(
Boolean test(T? it)) → T? -
Available on Array<
Returns single element, orT> , provided by the ArrayCompanion extensionnullif the array is empty or has more than one element. -
toTypedArray(
) → Array< T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
union(
Iterable< T> others) → Set<T> -
Available on Array<
T> , provided by the ArrayCompanion extension -
withIndex(
) → Iterable< int> -
Available on Array<
T> , provided by the ArrayCompanion extension
Operators
-
operator [](
int index) → dynamic -
Available on Array<
T> , provided by the ArrayCompanion extension -
operator []=(
int index, T value) → void -
Available on Array<
T> , provided by the ArrayCompanion extension