Arr<T>
extension type
A fixed-size array, denoted as T; N
in Rust.
Constructors
- Arr.new(T defaultVal, int size)
-
Arr.constant(List<
T> _list) -
const
- Arr.empty()
-
Arr.fromList(List<
T> _list) - Arr.generate(int length, T generator(int))
Properties
- first → T
-
The first element.
no setterinherited
- firstOrNull → T?
-
Available on Iterable<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnull
if the iterable is empty.no setter -
firstOrOption
→ Option<
T> -
Returns the first element of an iterator, None if empty.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
indexed
→ Iterable<
(int, T)> -
Available on Iterable<
Pairs of elements of the indices and elements of this iterable.T> , provided by the IterableExtensions extensionno setter - isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
T> -
A new
Iterator
that allows iterating the elements of thisIterable
.no setteroverride - last → T
-
The last element.
no setterinherited
- lastOrNull → T?
-
Available on Iterable<
The last element of this iterable, orT> , provided by the IterableExtensions extensionnull
if the iterable is empty.no setter -
lastOrOption
→ Option<
T> -
Returns the last element of an iterator, None if empty.
no setter
- length → int
-
The number of elements in this Iterable.
no setterinherited
-
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnull
elements of this iterable.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → T
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- singleOrNull → T?
-
Returns the single element of an iterator, null if this is empty or has more than one element.
no setter
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull
.no setter -
singleOrOption
→ Option<
T> -
Returns the single element of an iterator, None if this is empty or has more than one element.
no setter
-
wait
→ Future<
List< T> > -
Available on Iterable<
Waits for futures in parallel.Future< , provided by the FutureIterable extensionT> >no setter
Methods
-
any(
bool test(T element)) → bool -
Checks whether any element of this iterable satisfies
test
.inherited -
asList(
) → List< T> -
asNameMap(
) → Map< String, T> -
Available on Iterable<
Creates a map from the names of enum values to the values.T> , provided by the EnumByName extension -
asSlice(
) → Slice< T> -
asVec(
) → Vec< T> -
Available on Arr<
T> , provided by the Vec$ArrExtension extension -
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname
. -
call(
RangeBounds range) → Slice< T> -
cast<
U> () → Arr< U> -
Casts this Arr
override
-
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element
.inherited -
elementAt(
int index) → T -
Returns the
index
th element.inherited -
elementAtOrNull(
int index) → T? -
Available on Iterable<
The element at positionT> , provided by the IterableExtensions extensionindex
of this iterable, ornull
. -
every(
bool test(T element)) → bool -
Checks whether every element of this iterable satisfies
test
.inherited -
expand<
U> (Iterable< U> f(T)) → Iter<U> -
Expands each element of this Iterable into zero or more elements.
override
-
firstWhere(
bool test(T element), {T orElse()?}) → T -
The first element that satisfies the given predicate
test
.inherited -
fold<
T> (T initialValue, T combine(T previousValue, T element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< T> other) → Iter<T> -
Creates the lazy concatenation of this iterable and
other
.override -
forEach(
void action(T element)) → void -
Invokes
action
on each element of this iterable in iteration order.inherited -
isEmpty(
) → bool - Returns true if the iterator is empty, false otherwise.
-
isNotEmpty(
) → bool - Returns true if the iterator is not empty, false otherwise.
-
iter(
) → Iter< T> -
Available on Iterable<
Returns an Iter over the Iterable.T> , provided by the Iter$IterableExtension extension -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(T element), {T orElse()?}) → T -
The last element that satisfies the given predicate
test
.inherited -
len(
) → int - Returns the length of an iterator.
-
map<
U> (U f(T)) → Arr< U> -
Returns an array of the same size as self, with function f applied to each element in order.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(
T combine(T value, T element)) → T -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
rsplitSlice(
int index) → (Slice< T> , Slice<T> ) - Divides array into two Slices at index from end. The first will contain all indices from [0, N - M) (excluding the index N - M itself) and the second will contain all indices from [N - M, N) (excluding the index N itself).
-
singleWhere(
bool test(T element), {T orElse()?}) → T -
The single element that satisfies
test
.inherited -
skip(
int count) → Iter< T> -
Creates an Iterable that provides all but the first
count
elements.override -
skipWhile(
bool f(T)) → Iter< T> -
Creates an
Iterable
that skips leading elements whiletest
is satisfied.override -
slice(
[int start = 0, int? end]) → Slice< T> -
splitSlice(
int index) → (Slice< T> , Slice<T> ) - Divides array into two Slices at index from start. The first will contain all indices from [0, M) (excluding the index M itself) and the second will contain all indices from [M, N) (excluding the index N itself).
-
take(
int count) → Iter< T> -
Creates a lazy iterable of the
count
first elements of this iterable.override -
takeWhile(
bool f(T)) → Iter< T> -
Creates a lazy iterable of the leading elements satisfying
test
.override -
toArr(
) → Arr< T> -
Available on Iterable<
Creates an Array from an IterableT> , provided by the Array$IterableExtension extension -
toList(
{bool growable = true}) → List< T> -
Creates a List containing the elements of this Iterable.
inherited
-
toNullables(
) → Iterable< T?> -
Available on Iterable<
Option< , provided by the Iter$IterableOption extensionT> > -
toOptions(
) → Iterable< Option< T> > -
Available on Iterable<
T?> , provided by the Iter$IterableNullable extension -
toResult(
) → FutureResult< List< S> , List<F> > -
Available on Iterable<
Transforms an Iterable of FutureResults into a single result where the ok value is the list of all successes and err value is a list of all failures. The order ofFutureResult< , provided by the Result$IterableFutureResultExtension extensionS, F> >S
andF
is determined by the order in the List. -
toResult(
) → Result< List< S> , List<F> > -
Available on Iterable<
Transforms an Iterable of results into a single result where the ok value is the list of all successes and err value is a list of all failures.Result< , provided by the Result$IterableResultExtension extensionS, F> > -
toResultEager(
) → FutureResult< List< S> , F> -
Available on Iterable<
Transforms an Iterable of FutureResults into a single result where the ok value is the list of all successes. If any error is encountered, the first error is used as the error result. The order ofFutureResult< , provided by the Result$IterableFutureResultExtension extensionS, F> >S
andF
is determined by the order in which futures complete. -
toResultEager(
) → Result< List< S> , F> -
Available on Iterable<
Transforms an Iterable of results into a single result where the ok value is the list of all successes. If any error is encountered, the first error is used as the error result.Result< , provided by the Result$IterableResultExtension extensionS, F> > -
toSet(
) → Set< T> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
Returns a string representation of (some of) the elements of
this
.inherited -
toVec(
) → Vec< T> -
Available on Iterable<
T> , provided by the Vec$IterableExtension extension -
tryMap<
S, F extends Object> (Result< S, F> f(T)) → Result<Arr< S> , F> - A fallible function f applied to each element on this array in order to return an array the same size as this or the first error encountered.
-
where(
bool f(T)) → Iter< T> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test
.override -
whereType<
U> () → Iter< U> -
Creates a new lazy Iterable with all elements that have type
T
.override
Operators
-
operator +(
Arr< T> other) → dynamic -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → T -
operator []=(
int index, T value) → void