Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compare ¶
Compare a and b
if a > b return number > 0
if a == b return 0
if a < b return number < 0
type Stream ¶
type Stream[T any] interface { // Filter returns a stream consisting of the elements of this stream that match the given predicate Filter(Filter[T]) Stream[T] // ForEach performs an action for each element of this stream ForEach(ForEach[T]) // Reverse returns a stream consisting of the elements of this stream, reverse the order of elements Reverse() Stream[T] // Count returns the count of elements in this stream Count() int // ToSlice return slice containing the elements of this stream ToSlice() []T // Limit returns a stream consisting of the elements of this stream, truncated to be no longer than maxSize in length Limit(int) Stream[T] // Min returns the minimum element of this stream according to the provided Comparator Min(Compare[T]) T // Max returns the maximum element of this stream according to the provided Comparator Max(Compare[T]) T // Skip returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream // If this stream contains fewer than do nothing Skip(int) Stream[T] // Sorted Returns a stream consisting of the elements of this stream, sorted according to the given method Sorted(Compare[T]) Stream[T] // Peek returns a stream consisting of the elements of this stream, // additionally performing the provided action on each element as elements are consumed from the resulting stream Peek(ForEach[T]) Stream[T] // AnyMatch returns whether any elements of this stream match the provided predicate. // May not evaluate the predicate on all elements if not necessary for determining the result. // If the stream is empty then false is returned and the predicate is not evaluated AnyMatch(Match[T]) bool // AllMatch returns whether all elements of this stream match the provided predicate. // May not evaluate the predicate on all elements if not necessary for determining the result. // If the stream is empty then true is returned and the predicate is not evaluated AllMatch(Match[T]) bool // NoneMatch returns whether no elements of this stream match the provided predicate. // May not evaluate the predicate on all elements if not necessary for determining the result. // If the stream is empty then true is returned and the predicate is not evaluated NoneMatch(Match[T]) bool // FindAny returns an element that matches the given method, or any empty value if the stream is empty or not match FindAny(Match[T]) T // FindFirst returns an element describing the first element of this stream, or an empty value if the stream is empty FindFirst() T // FindLast returns an element describing the last element of this stream, or ant empty value if the stream is empty FindLast() T }
Click to show internal directories.
Click to hide internal directories.