ElLinkedList<N extends ElLinkedNode<N> > class
双向链表
Constructors
Properties
- first → N
-
第一个节点
no setteroverride
- firstOrNull → N?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether this collection has no elements.
no setteroverride
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
-
iterator
→ Iterator<
N> -
A new
Iteratorthat allows iterating the elements of thisIterable.no setteroverride - last → N
-
最后一个节点
no setteroverride
- lastOrNull → N?
-
no setter
- length → int
-
链表长度
no setteroverride
- maxPrintLength → int
-
打印链表时限制最大长度
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → N
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
Methods
-
add(
N node) → void - 添加一个节点
-
addAll(
Iterable< N> nodes) → void - 添加多个节点
-
addAllFirst(
Iterable< N> nodes) → void - 在前面添加多个节点,注意:如果要保持 List 插入顺序,请反转集合
-
addFirst(
N node) → void - 在前面添加一个节点
-
any(
bool test(N element)) → bool -
Checks whether any element of this iterable satisfies
test.inherited -
cast<
R> () → Iterable< R> -
A view of this iterable as an iterable of
Rinstances.inherited -
clear(
) → void - 清空链表
-
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element.inherited -
elementAt(
int index) → N -
根据下标寻找目标节点,首尾查找很便宜,寻找中间节点耗时最长,时间复杂度 O(n) / 2
override
-
every(
bool test(N element)) → bool -
Checks whether every element of this iterable satisfies
test.inherited -
expand<
T> (Iterable< T> toElements(N element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
find(
bool test(N element)) → N? - 按条件查找节点
-
firstWhere(
bool test(N element), {N orElse()?}) → N -
The first element that satisfies the given predicate
test.inherited -
fold<
T> (T initialValue, T combine(T previousValue, N element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
Iterable< N> other) → Iterable<N> -
Creates the lazy concatenation of this iterable and
other.inherited -
forEach(
void action(N element)) → void -
Invokes
actionon each element of this iterable in iteration order.inherited -
initNode(
N node) → void - 初始化节点
-
insert(
N targetNode, N newNode, {bool isBefore = false}) → void - 在目标节点插入新的节点:
-
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastWhere(
bool test(N element), {N orElse()?}) → N -
The last element that satisfies the given predicate
test.inherited -
map<
T> (T toElement(N e)) → Iterable< T> -
The current elements of this iterable modified by
toElement.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reduce(
N combine(N value, N element)) → N -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
remove(
N node) → void - 删除节点
-
singleWhere(
bool test(N element), {N orElse()?}) → N -
The single element that satisfies
test.inherited -
skip(
int count) → Iterable< N> -
Creates an Iterable that provides all but the first
countelements.inherited -
skipWhile(
bool test(N value)) → Iterable< N> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
swap(
N node1, N node2) → void - 交换两个节点的位置
-
take(
int count) → Iterable< N> -
Creates a lazy iterable of the
countfirst elements of this iterable.inherited -
takeWhile(
bool test(N value)) → Iterable< N> -
Creates a lazy iterable of the leading elements satisfying
test.inherited -
toList(
{bool growable = true}) → List< N> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< N> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
Returns a string representation of (some of) the elements of
this.override -
where(
bool test(N element)) → Iterable< N> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.inherited -
whereType<
T> () → Iterable< T> -
Creates a new lazy Iterable with all elements that have type
T.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited