public class _CollectionKt
| 限定符和类型 | 方法和说明 |
|---|---|
static <K,V> boolean |
any(java.util.Map<? extends K,? extends V> $receiver,
kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Boolean> predicate)
Returns
true if at least one entry matches the given predicate. |
static <K,V> java.util.Map<K,V> |
associate(java.util.Map<?,?> $receiver,
kotlin.jvm.functions.Function1<? super java.util.Map.Entry<?,?>,? extends kotlin.Pair<?extendsK,?extendsV>> transform)
Returns a Map containing key-value pairs provided by transform function
applied to elements of the given array.
|
static <A,B,K,V> java.util.Map<K,V> |
associate(java.util.Map<A,? extends B> $receiver,
kotlin.jvm.functions.Function2<? super A,? super B,? extends kotlin.Pair<?extendsK,?extendsV>> transform)
Returns a Map containing key-value pairs provided by transform function
applied to elements of the given array.
|
static java.lang.StringBuilder |
buildQueryString(java.util.Map<?,?> $receiver,
java.lang.StringBuilder str,
boolean encoding)
将参数转为查询字符串
|
static java.lang.String |
buildQueryString(java.util.Map<?,?> $receiver,
boolean encoding)
将参数转为查询字符串
|
static void |
clear(java.lang.Object[] $receiver)
清空数据
|
static <K,V> java.util.Collection<V> |
collectColumn(java.util.Collection<? extends java.util.Map<K,?extendsV>> $receiver,
K key)
收集某列的值
|
static boolean |
containsAllKeys(java.util.Map<?,?> $receiver,
java.lang.Object keys)
检查是否包含所有键
|
static boolean |
containsAnyKey(java.util.Map<?,?> $receiver,
java.lang.Object keys)
检查是否包含任一个键
|
static <T,R> java.util.Collection<R> |
decorateCollection(java.util.Collection<? extends T> col,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
包装迭代器
|
static <T,R> java.util.Iterator<R> |
decorateIterator(java.util.Iterator<? extends T> iterator,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
包装迭代器
|
static <E> int |
drainTo(java.util.concurrent.ConcurrentLinkedQueue<E> $receiver,
java.util.Collection<E> c,
int maxElements)
从队列中抽取指定数目的元素
注意: ConcurrentLinkedQueue 中元素不能为null, 同时size() 是遍历性能慢, 尽量使用 isEmpty()
|
static int[] |
emptyIntArray()
空数组
|
static <T> ItEnumeration<T> |
enumeration(java.lang.Iterable<? extends T> $receiver)
获得Enumeration
|
static <E> E |
get(java.util.Collection<? extends E> $receiver,
int index)
Returns the element at the specified position in this collection.
|
static java.math.BigDecimal |
getBigDecimal(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: decimal, numeric
|
static java.math.BigInteger |
getBigInteger(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: unsigned bigint
|
static java.lang.Boolean |
getBoolean(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: bit, tinyint(1)
|
static byte[] |
getBytes(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: binary, varbinary, tinyblob, blob, mediumblob, longblob
|
static java.util.Date |
getDate(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: date, year
|
static java.lang.Double |
getDouble(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: real, double
|
static java.lang.Float |
getFloat(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: float
|
static java.lang.Integer |
getInt(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: int, integer, tinyint(n) n > 1, smallint, mediumint
|
static java.lang.Long |
getLong(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: bigint, unsign int
|
static java.lang.Number |
getNumber(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of any type that extends from Number
|
static <K,V> V |
getOrDefault(java.util.Map<K,? extends V> $receiver,
K key,
V p)
获得map的某个值,如果值为空,则返回默认值
|
static <T> T |
getOrPut(T[] $receiver,
int index,
kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends T> defaultValue)
获得数组的某个元素值,如果值为空,则给该元素赋值
|
static <K,V> V |
getOrPutOnce(java.util.concurrent.ConcurrentMap<K,V> $receiver,
K key,
kotlin.jvm.functions.Function0<? extends V> defaultValue)
改进 getOrPut(), 其中 defaultValue() 只调用一次, 用于减少大对象与资源(如db连接)创建的情况
|
static java.lang.Short |
getShort(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: tinyint(1)
|
static int |
getSize(kotlin.ranges.IntProgression $receiver)
大小
|
static int |
getSize(kotlin.ranges.LongProgression $receiver)
大小
|
static java.lang.String |
getString(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: varchar, char, enum, set, text, tinytext, mediumtext, longtext
|
static java.sql.Time |
getTime(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: time
|
static java.sql.Timestamp |
getTimestamp(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: timestamp, datetime
|
static <T,K> java.util.Map<K,java.lang.Integer> |
groupCount(java.lang.Iterable<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
统计个数
|
static boolean |
isArray(java.lang.Object $receiver)
是否数组
|
static boolean |
isArrayOrCollection(java.lang.Object $receiver)
是否数组或集合
|
static boolean |
isArrayOrCollectionEmpty(java.lang.Object $receiver)
是否数组或集合为空
|
static <E> boolean |
isNullOrEmpty(java.util.Collection<? extends E> $receiver)
检查集合是否为空
|
static java.util.Iterator<?> |
iteratorArrayOrCollection(java.lang.Object $receiver)
获得数组或集合的迭代器
|
static <T> java.lang.StringBuilder |
joinTo(java.util.Iterator<? extends T> $receiver,
java.lang.StringBuilder buffer,
java.lang.CharSequence separator,
java.lang.CharSequence prefix,
java.lang.CharSequence postfix,
int limit,
java.lang.CharSequence truncated,
kotlin.jvm.functions.Function1<? super T,? extends java.lang.CharSequence> transform)
Appends the string from all the elements separated using separator and using the given prefix and postfix if supplied.
|
static <T> java.lang.String |
joinToString(java.util.Iterator<? extends T> $receiver,
java.lang.CharSequence separator,
java.lang.CharSequence prefix,
java.lang.CharSequence postfix,
int limit,
java.lang.CharSequence truncated,
kotlin.jvm.functions.Function1<? super T,? extends java.lang.CharSequence> transform)
Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.
|
static <T,R> java.util.List<R> |
map(java.util.Iterator<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function
to each element in the original collection.
|
static <T,R,C extends Collection<? super R>> |
mapTo(java.util.Iterator<? extends T> $receiver,
C destination,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Applies the given transform function to each element of the original collection
and appends the results to the given destination.
|
static <T,R> java.util.Set<R> |
mapToSet(java.lang.Iterable<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function
to each element in the original set.
|
static java.lang.Object |
path(java.util.Map<java.lang.String,?> $receiver,
java.lang.String path,
boolean withException,
java.lang.Object p)
获得.分割的路径下的子项值
|
static <T> void |
pollEach(java.util.Queue<T> $receiver,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> action)
逐个出队元素, 并访问
|
static <K,V> java.util.Map<K,V> |
removeAll(java.util.Map<K,V> $receiver,
java.util.Collection<? extends K> keys)
map删除多个key
|
static java.lang.Object[] |
repeateToArray(java.lang.Object $receiver,
int times)
构建重复元素的数组
|
static java.util.List<java.lang.Object> |
repeateToList(java.lang.Object $receiver,
int times)
构建重复元素的列表
|
static void |
setPath(java.util.Map<java.lang.String,java.lang.Object> $receiver,
java.lang.String path,
java.lang.Object value)
设置.分割的路径下的子项值
|
static <T> long |
sumByLong(java.lang.Iterable<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,java.lang.Long> selector)
Returns the sum of all values produced by selector function applied to each element in the collection.
|
static <T> T[] |
toArray(T params)
非空参数转为array, 仅用于在 DbKey/Orm 的构造函数中转参数
|
static java.lang.String |
toDesc(java.util.Iterator<?> $receiver)
转字符串
|
static java.util.Map<?,?> |
toMap(java.util.Collection<? extends java.util.Map<?,?>> $receiver,
java.lang.String keyField,
java.lang.String valueField)
map列表转哈希
|
static java.lang.StringBuilder |
toQueryString(java.util.Map<java.lang.String,kotlin.Array[]> $receiver,
java.lang.StringBuilder buffer)
请求参数转query string
|
static java.lang.String |
toQueryString(java.util.Map<java.lang.String,kotlin.Array[]> $receiver)
请求参数转query string
|
public static int[] emptyIntArray()
空数组
public static void clear(java.lang.Object[] $receiver)
清空数据
public static <T> T[] toArray(T params)
非空参数转为array, 仅用于在 DbKey/Orm 的构造函数中转参数
public static java.lang.Object[] repeateToArray(java.lang.Object $receiver,
int times)
构建重复元素的数组
public static java.util.List<java.lang.Object> repeateToList(java.lang.Object $receiver,
int times)
构建重复元素的列表
public static boolean isArray(java.lang.Object $receiver)
是否数组
public static boolean isArrayOrCollection(java.lang.Object $receiver)
是否数组或集合
public static boolean isArrayOrCollectionEmpty(java.lang.Object $receiver)
是否数组或集合为空
public static java.util.Iterator<?> iteratorArrayOrCollection(java.lang.Object $receiver)
获得数组或集合的迭代器
public static <E> boolean isNullOrEmpty(java.util.Collection<? extends E> $receiver)
检查集合是否为空
public static <E> E get(java.util.Collection<? extends E> $receiver,
int index)
Returns the element at the specified position in this collection.
public static <T> T getOrPut(T[] $receiver,
int index,
kotlin.jvm.functions.Function1<? super java.lang.Integer,? extends T> defaultValue)
获得数组的某个元素值,如果值为空,则给该元素赋值
public static <T,K> java.util.Map<K,java.lang.Integer> groupCount(java.lang.Iterable<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,? extends K> keySelector)
统计个数
public static int getSize(kotlin.ranges.IntProgression $receiver)
大小
public static int getSize(kotlin.ranges.LongProgression $receiver)
大小
public static java.lang.StringBuilder toQueryString(java.util.Map<java.lang.String,kotlin.Array[]> $receiver,
java.lang.StringBuilder buffer)
请求参数转query string
public static java.lang.String toQueryString(java.util.Map<java.lang.String,kotlin.Array[]> $receiver)
请求参数转query string
public static <T,R> java.util.List<R> map(java.util.Iterator<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function to each element in the original collection.
public static <T,R,C extends Collection<? super R>> C mapTo(java.util.Iterator<? extends T> $receiver, C destination, kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Applies the given transform function to each element of the original collection and appends the results to the given destination.
public static <T> java.lang.String joinToString(java.util.Iterator<? extends T> $receiver,
java.lang.CharSequence separator,
java.lang.CharSequence prefix,
java.lang.CharSequence postfix,
int limit,
java.lang.CharSequence truncated,
kotlin.jvm.functions.Function1<? super T,? extends java.lang.CharSequence> transform)
Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.
If the collection could be huge, you can specify a non-negative value of limit, in which case only the first limit elements will be appended, followed by the truncated string (which defaults to "...").
Unresolved: samples.collections.Collections.Transformations.joinToString
public static <T> java.lang.StringBuilder joinTo(java.util.Iterator<? extends T> $receiver,
java.lang.StringBuilder buffer,
java.lang.CharSequence separator,
java.lang.CharSequence prefix,
java.lang.CharSequence postfix,
int limit,
java.lang.CharSequence truncated,
kotlin.jvm.functions.Function1<? super T,? extends java.lang.CharSequence> transform)
Appends the string from all the elements separated using separator and using the given prefix and postfix if supplied.
If the collection could be huge, you can specify a non-negative value of limit, in which case only the first limit elements will be appended, followed by the truncated string (which defaults to "...").
Unresolved: samples.collections.Collections.Transformations.joinTo
public static java.lang.String toDesc(java.util.Iterator<?> $receiver)
转字符串
public static <T> ItEnumeration<T> enumeration(java.lang.Iterable<? extends T> $receiver)
获得Enumeration
public static <T,R> java.util.Iterator<R> decorateIterator(java.util.Iterator<? extends T> iterator,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
包装迭代器
public static <T,R> java.util.Collection<R> decorateCollection(java.util.Collection<? extends T> col,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
包装迭代器
public static <T,R> java.util.Set<R> mapToSet(java.lang.Iterable<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,? extends R> transform)
Returns a list containing the results of applying the given transform function to each element in the original set.
public static <T> long sumByLong(java.lang.Iterable<? extends T> $receiver,
kotlin.jvm.functions.Function1<? super T,java.lang.Long> selector)
Returns the sum of all values produced by selector function applied to each element in the collection.
public static <E> int drainTo(java.util.concurrent.ConcurrentLinkedQueue<E> $receiver,
java.util.Collection<E> c,
int maxElements)
从队列中抽取指定数目的元素 注意: ConcurrentLinkedQueue 中元素不能为null, 同时size() 是遍历性能慢, 尽量使用 isEmpty()
public static <T> void pollEach(java.util.Queue<T> $receiver,
kotlin.jvm.functions.Function1<? super T,kotlin.Unit> action)
逐个出队元素, 并访问
public static <K,V> V getOrDefault(java.util.Map<K,? extends V> $receiver,
K key,
V p)
获得map的某个值,如果值为空,则返回默认值
public static <K,V> V getOrPutOnce(java.util.concurrent.ConcurrentMap<K,V> $receiver,
K key,
kotlin.jvm.functions.Function0<? extends V> defaultValue)
改进 getOrPut(), 其中 defaultValue() 只调用一次, 用于减少大对象与资源(如db连接)创建的情况
public static boolean containsAnyKey(java.util.Map<?,?> $receiver,
java.lang.Object keys)
检查是否包含任一个键
public static boolean containsAllKeys(java.util.Map<?,?> $receiver,
java.lang.Object keys)
检查是否包含所有键
public static <K,V> java.util.Map<K,V> removeAll(java.util.Map<K,V> $receiver,
java.util.Collection<? extends K> keys)
map删除多个key
public static <K,V> java.util.Map<K,V> associate(java.util.Map<?,?> $receiver,
kotlin.jvm.functions.Function1<? super java.util.Map.Entry<?,?>,? extends kotlin.Pair<?extendsK,?extendsV>> transform)
Returns a Map containing key-value pairs provided by transform function applied to elements of the given array.
If any of two pairs would have the same key the last one gets added to the map.
public static <A,B,K,V> java.util.Map<K,V> associate(java.util.Map<A,? extends B> $receiver,
kotlin.jvm.functions.Function2<? super A,? super B,? extends kotlin.Pair<?extendsK,?extendsV>> transform)
Returns a Map containing key-value pairs provided by transform function applied to elements of the given array.
If any of two pairs would have the same key the last one gets added to the map.
public static <K,V> boolean any(java.util.Map<? extends K,? extends V> $receiver,
kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Boolean> predicate)
Returns true if at least one entry matches the given predicate.
Unresolved: samples.collections.Collections.Aggregates.anyWithPredicate
public static java.lang.Object path(java.util.Map<java.lang.String,?> $receiver,
java.lang.String path,
boolean withException,
java.lang.Object p)
获得.分割的路径下的子项值
public static void setPath(java.util.Map<java.lang.String,java.lang.Object> $receiver,
java.lang.String path,
java.lang.Object value)
设置.分割的路径下的子项值
public static <K,V> java.util.Collection<V> collectColumn(java.util.Collection<? extends java.util.Map<K,?extendsV>> $receiver,
K key)
收集某列的值
public static java.util.Map<?,?> toMap(java.util.Collection<? extends java.util.Map<?,?>> $receiver,
java.lang.String keyField,
java.lang.String valueField)
map列表转哈希
public static java.lang.StringBuilder buildQueryString(java.util.Map<?,?> $receiver,
java.lang.StringBuilder str,
boolean encoding)
将参数转为查询字符串
public static java.lang.String buildQueryString(java.util.Map<?,?> $receiver,
boolean encoding)
将参数转为查询字符串
public static java.lang.String getString(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: varchar, char, enum, set, text, tinytext, mediumtext, longtext
public static java.lang.Integer getInt(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: int, integer, tinyint(n) n > 1, smallint, mediumint
public static java.lang.Long getLong(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: bigint, unsign int
public static java.math.BigInteger getBigInteger(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: unsigned bigint
public static java.util.Date getDate(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: date, year
public static java.sql.Time getTime(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: time
public static java.sql.Timestamp getTimestamp(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: timestamp, datetime
public static java.lang.Double getDouble(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: real, double
public static java.lang.Float getFloat(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: float
public static java.lang.Boolean getBoolean(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: bit, tinyint(1)
public static java.lang.Short getShort(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: tinyint(1)
public static java.math.BigDecimal getBigDecimal(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: decimal, numeric
public static byte[] getBytes(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of db type: binary, varbinary, tinyblob, blob, mediumblob, longblob
public static java.lang.Number getNumber(java.util.Map<java.lang.String,?> $receiver,
java.lang.String name)
Get attribute of any type that extends from Number