程序包 amo.lib.linq
类 AbstractStream<T>
java.lang.Object
amo.lib.linq.AbstractStream<T>
- 直接已知子类:
MapStream
public abstract class AbstractStream<T> extends Object implements Stream<T>
-
构造器概要
构造器 构造器 说明 AbstractStream() -
方法概要
修饰符和类型 方法 说明 <R> Raggregate(R seed, Aggregator<T,R> aggregator)Applies an accumulator function over a sequence.intcount()Returns the number of elements in a sequence.Stream<T>distinct()Returns distinct elements from a sequence by using the objectequals()to compare values.Tfind(Predicate<T> predicate)find目前使用的where,可以为find添加独立的Stream支持,找到一个equ时就终止next,修改where,在next时记录是否已经有匹配的,如果有了,hasnext返回 false,反正find就只返回一个List<T>findAll(Predicate<T> predicate)Tfirst()Returns the first element of a sequence; this method throws an exception if the sequence is empty.Tfirst(Predicate<T> predicate)Returns the first element in a sequence that satisfies the specified condition; this method throws an exception if no element in the sequence satisfies the condition.<K> Stream<Grouping<K,T>>groupBy(Selector<T,K> keySelector)Groups the elements of a sequence according to a specified key selector function.<K, E> Stream<Grouping<K,E>>groupBy(Selector<T,K> keySelector, Selector<T,E> elementSelector)Groups the elements of a sequence according to a specified key selector function.<R extends Comparable<R>>
OrderedStream<T>orderBy(Selector<T,R> keySelector)Sorts the elements of a sequence in ascending order according to a key.<R> OrderedStream<T>orderBy(Selector<T,R> keySelector, Comparator<R> comparator)Sorts the elements of a sequence in ascending order according to a key.<R extends Comparable<R>>
OrderedStream<T>orderByDescending(Selector<T,R> keySelector)Sorts the elements of a sequence in descending order according to a key.<R> OrderedStream<T>orderByDescending(Selector<T,R> keySelector, Comparator<R> comparator)Sorts the elements of a sequence in descending order according to a key.protected Iterator<T>reverseIterator()<R> Stream<R>select(Selector<T,R> selector)Projects each element of a sequence into a new form.Stream<T>skip(int count)Skips a specified number of contiguous elements from the start of a sequence then returns remaining elements.Stream<T>take(int count)Returns a specified number of contiguous elements from the start of a sequence.List<T>toList()Creates a List from a Stream.Stream<T>where(Predicate<T> predicate)Filters a sequence of values based on a predicate.
-
构造器详细资料
-
AbstractStream
public AbstractStream()
-
-
方法详细资料
-
reverseIterator
-
where
从接口复制的说明:StreamFilters a sequence of values based on a predicate. -
select
从接口复制的说明:StreamProjects each element of a sequence into a new form. -
find
从接口复制的说明:Streamfind目前使用的where,可以为find添加独立的Stream支持,找到一个equ时就终止next,修改where,在next时记录是否已经有匹配的,如果有了,hasnext返回 false,反正find就只返回一个 -
findAll
-
groupBy
public <K, E> Stream<Grouping<K,E>> groupBy(Selector<T,K> keySelector, Selector<T,E> elementSelector)从接口复制的说明:StreamGroups the elements of a sequence according to a specified key selector function.- 指定者:
groupBy在接口中Stream<T>- 类型参数:
K- The type of the key returned by keySelector.E- The type of the element returned by elementSelector.- 参数:
keySelector- A function to extract the key for each source element.elementSelector- A function to map each source element to an element into a Grouping.- 返回:
- An Stream of type Grouping where each Grouping object contains a sequence of objects and a key (TKey, TResult respectively).
-
groupBy
从接口复制的说明:StreamGroups the elements of a sequence according to a specified key selector function. -
orderBy
从接口复制的说明:StreamSorts the elements of a sequence in ascending order according to a key. -
orderBy
从接口复制的说明:StreamSorts the elements of a sequence in ascending order according to a key. -
orderByDescending
public <R> OrderedStream<T> orderByDescending(Selector<T,R> keySelector, Comparator<R> comparator)从接口复制的说明:StreamSorts the elements of a sequence in descending order according to a key.- 指定者:
orderByDescending在接口中Stream<T>- 类型参数:
R- The type of the key returned by keySelector.- 参数:
keySelector- A function to extract a key from an element.comparator- An Comparator to compare keys.- 返回:
- An Stream of type T whose elements are sorted according to a key.
-
orderByDescending
从接口复制的说明:StreamSorts the elements of a sequence in descending order according to a key.- 指定者:
orderByDescending在接口中Stream<T>- 类型参数:
R- The type of the key returned by keySelector.- 参数:
keySelector- A function to extract a key from an element.- 返回:
- An Stream of type T whose elements are sorted according to a key.
-
aggregate
从接口复制的说明:StreamApplies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. -
take
从接口复制的说明:StreamReturns a specified number of contiguous elements from the start of a sequence. -
skip
从接口复制的说明:StreamSkips a specified number of contiguous elements from the start of a sequence then returns remaining elements. -
distinct
从接口复制的说明:StreamReturns distinct elements from a sequence by using the objectequals()to compare values. -
count
public int count()从接口复制的说明:StreamReturns the number of elements in a sequence. -
first
从接口复制的说明:StreamReturns the first element of a sequence; this method throws an exception if the sequence is empty. -
first
从接口复制的说明:StreamReturns the first element in a sequence that satisfies the specified condition; this method throws an exception if no element in the sequence satisfies the condition. -
toList
从接口复制的说明:StreamCreates a List from a Stream.
-