List_E<E> class
Enhanced List type for Zorphy with additional functionality
Constructors
-
List_E(List<
E> _list) -
Wraps a list to provide fluent helper methods.
const
- List_E.empty()
-
Creates an empty List_E
factory
- List_E.filled(int length, E fill)
-
Creates a fixed-length list
factory
-
List_E.from(Iterable<
E> elements) -
Creates a list from an iterable
factory
- List_E.generate(int length, E generator(int index))
-
Creates a list with
lengthpositions and fills each position withgeneratorfactory - List_E.growable([int length = 0])
-
Creates a growable list with the specified length
factory
Properties
- hashCode → int
-
Returns a hash code based on list contents.
no setteroverride
- isEmpty → bool
-
Returns true when the list has no elements.
no setter
- isNotEmpty → bool
-
Returns true when the list has at least one element.
no setter
-
iterator
→ Iterator<
E> -
Returns an iterator over the elements.
no setter
- length → int
-
Returns the number of elements.
no setter
-
list
→ List<
E> -
Returns the underlying list.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
E value) → void -
Appends
valueto the end of the list. -
addAll(
Iterable< E> iterable) → void -
Appends all elements from
iterable. -
clear(
) → void - Removes all elements.
-
insertAll(
int index, Iterable< E> iterable) → void -
Adds all elements of
otherto the end of this list -
map<
R> (R f(E e)) → List_E< R> - Maps each element and returns a new List_E.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
Object? value) → bool -
Removes the first matching
value, returning true if found. -
removeRange(
int start, int end) → void -
Removes a range of elements from
starttoend -
skip(
int n) → List_E< E> - Returns a new List_E without the first n elements
-
sort(
[int compare(E a, E b)?]) → void -
Sorts this list according to the order specified by the
comparefunction -
take(
int n) → List_E< E> - Returns a new List_E with the first n elements
-
toString(
) → String -
Returns a string representation of the list.
override
-
where(
bool f(E e)) → List_E< E> - Filters elements and returns a new List_E.
Operators
-
operator ==(
Object other) → bool -
Compares two List_E instances by value.
override
-
operator [](
int index) → E -
Reads the element at
index. -
operator []=(
int index, E value) → void -
Writes
valueatindex.