ListUtil class

数组工具集

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

arraycopy(List src, int srcPos, List dest, int destPos, int length) → void
数组拷贝
copyOf(List<int> original, int newLength) Uint8List
复制指定的数组,用零截断或填充(如有必要),以便副本具有指定的长度。 对于在原始数组和副本中都有效的所有索引,这两个数组将包含相同的值。 对于在副本中有效但在原始副本中无效的任何索引,副本将包含(byte)0 。 当且仅当指定长度大于原始数组的长度时,此类索引才会存在。
copyOfList<T extends List<int>>(List<int> original, T newList) → T
复制指定的数组,用零截断或填充(如有必要),以便副本具有指定的长度。 对于在原始数组和副本中都有效的所有索引,这两个数组将包含相同的值。 对于在副本中有效但在原始副本中无效的任何索引,副本将包含(byte)0 。 当且仅当指定长度大于原始数组的长度时,此类索引才会存在。
fill<T>(List<T> a, T val) → void
将指定的值分配给指定数组的每个元素。
insertAll(List<int> source, List<int> dest, int index, List<int> elements) → void
在目标数组中插入元素,dest可以是新数组也可以是原数组,如果是原数组需要保证可修改 dest中的元素将会被source的元素覆盖
isEmpty(Iterable? iterable) bool
如果此集合中为null,或者没有元素,则返回true 。
max(List<int> data) int
取最大值
min(List<int> data) int
取最小值
range({int includedStart = 0, required int excludedEnd, int step = 1}) List<int>
生成一个数字列表
reverse(List collection, [int? len]) → void
在原集合操作元素顺序反转,默认的len长度为集合的长度
slice<E>(List<E> list, int start, [int end = -1]) List<E>
返回一个新列表,其中包含在start (含)和end (含)之间的索引处的元素。
swap<E>(List<E> array, int index1, int index2) List<E>
交换数组中两个位置的值 交换后的数组,与传入数组为同一对象