public abstract class Seq<T> extends Object implements CollectionLike<T>
| Constructor and Description |
|---|
Seq() |
| Modifier and Type | Method and Description |
|---|---|
abstract Seq<T> |
append(T... that)
[Original] Appends the passed elements
This method is similar to scala.collectoin.Seq#+:(A)
|
static <T> Seq<T> |
apply(Enumeration<T> e) |
static <T> Seq<T> |
apply(Iterable<T> iterable) |
static <T> Seq<T> |
apply(Iterator<T> iter) |
static <T> Seq<T> |
apply(T... values) |
protected static <T> Seq<T> |
applyCollection(Collection<T> col) |
abstract boolean |
contains(T elem)
Tests whether this sequence contains a given value as an element.
|
abstract <U> Function1<Function2<T,U,Boolean>,Boolean> |
corresponds(Seq<U> that)
Curried
corresponds(Seq) |
abstract <U> boolean |
corresponds(Seq<U> that,
Function2<T,U,Boolean> p)
Tests whether every element of this sequence relates to the corresponding
element of another sequence by satisfying a test predicate.
|
abstract int |
count(Function1<T,Boolean> p)
Counts the number of elements in the sequence which satisfy a predicate.
|
abstract Seq<T> |
diff(Seq<T> that)
Computes the multiset difference between this sequence and another
sequence.
|
abstract Seq<T> |
distinct()
Builds a new sequence from this sequence without any duplicate elements.
|
abstract Seq<T> |
drop(int n)
Selects all elements except first n ones.
|
abstract Seq<T> |
dropNull()
[Original] Drops null elements
|
abstract Seq<T> |
dropRight(int n)
Selects all elements except last n ones.
|
abstract Seq<T> |
dropWhile(Function1<T,Boolean> p)
Drops longest prefix of elements that satisfy a predicate.
|
abstract boolean |
endsWith(Seq<T> that)
Tests whether this sequence ends with the given sequence.
|
abstract boolean |
exists(Function1<T,Boolean> p)
Tests whether a predicate holds for some of the elements of this
sequence.
|
abstract Seq<T> |
filter(Function1<T,Boolean> f)
Selects all elements of this sequence which satisfy a predicate.
|
abstract Seq<T> |
filterNot(Function1<T,Boolean> f)
Selects all elements of this immutable sequence which do not satisfy a
predicate.
|
abstract Option<T> |
find(Function1<T,Boolean> p)
Finds the first element of the sequence satisfying a predicate, if any.
|
abstract <U> Seq<U> |
flatMap(Function1<T,CollectionLike<U>> f)
Builds a new collection by applying a function to all elements of this
sequence and concatenating the results.
|
abstract <U> Function1<Function2<U,T,U>,U> |
foldLeft(U z)
Curried
foldLeft(Object, Function2) |
abstract <U> U |
foldLeft(U z,
Function2<U,T,U> op)
Applies a binary operator to a start value and all elements of this
sequence, going left to right.
|
abstract <U> Function1<Function2<T,U,U>,U> |
foldRight(U z)
Curried
foldRight(Object, Function2) |
abstract <U> U |
foldRight(U z,
Function2<T,U,U> op)
Applies a binary operator to all elements of this sequence and a start
value, going right to left.
|
abstract boolean |
forall(Function1<T,Boolean> p)
Tests whether a predicate holds for all elements of this sequence.
|
abstract <U> SMap<U,Seq<T>> |
groupBy(Function1<T,U> f)
Partitions this sequence into a map of sequences according to some
discriminator function.
|
abstract T |
head()
Selects the first element of this sequence.
|
abstract Option<T> |
headOption()
Optionally selects the first element.
|
abstract int |
indexOf(T elem)
Finds index of first occurrence of some value in this sequence after or
at some start index.
|
abstract Seq<Integer> |
indices()
Produces the range of all indices of this sequence.
|
abstract Seq<T> |
init()
Selects all elements except the last.
|
abstract Seq<T> |
intersect(Seq<T> that)
Computes the multiset intersection between this sequence and another
sequence.
|
abstract boolean |
isDefinedAt(int idx)
Tests whether this sequence contains given index.
|
abstract T |
last()
Selects the last element.
|
abstract Option<T> |
lastOption()
Optionally selects the last element.
|
abstract <U> Seq<U> |
map(Function1<T,U> f)
Builds a new collection by applying a function to all elements of this
sequence.
|
abstract SNum |
max()
Finds the largest element.
|
abstract SNum |
min()
Finds the smallest element.
|
abstract String |
mkString()
Displays all elements of this sequence in a string.
|
abstract String |
mkString(String sep)
Displays all elements of this sequence in a string using a separator
string.
|
abstract String |
mkString(String start,
String sep,
String end)
Displays all elements of this sequence in a string using start, end, and
separator strings.
|
abstract Seq<T> |
padTo(int len,
T elem)
Appends an element value to this sequence until a given target length is
reached.
|
abstract ParSeq<T> |
par()
Returns a parallel implementation of this collection.
|
abstract Tuple2<Seq<T>,Seq<T>> |
partition(Function1<T,Boolean> p)
Partitions this sequence in two sequences according to a predicate.
|
abstract Seq<T> |
patch(int from,
Seq<T> patch,
int replaced)
Produces a new sequence where a slice of elements in this sequence is
replaced by another sequence.
|
abstract <U> U |
reduceLeft(Function2<U,T,U> op)
Applies a binary operator to all elements of this immutable sequence,
going left to right.
|
abstract <U> Option<U> |
reduceLeftOption(Function2<U,T,U> op)
Optionally applies a binary operator to all elements of this immutable
sequence, going left to right.
|
abstract <U> U |
reduceRight(Function2<T,U,U> op)
Applies a binary operator to all elements of this immutable sequence,
going right to left.
|
abstract <U> Option<U> |
reduceRightOption(Function2<T,U,U> op)
Optionally applies a binary operator to all elements of this immutable
sequence, going right to left.
|
abstract Seq<T> |
reverse()
Returns new sequence wih elements in reversed order.
|
abstract <U> Seq<U> |
reverseMap(Function1<T,U> f)
Builds a new collection by applying a function to all elements of this
sequence and collecting the results in reversed order.
|
abstract boolean |
sameElements(Seq<T> that)
Checks if the other iterable collection contains the same elements in the
same order as this sequence.
|
abstract <U> Function1<Function2<U,T,U>,Seq<U>> |
scanLeft(U z)
Curried
scanLeft(Object, Function2) |
abstract <U> Seq<U> |
scanLeft(U z,
Function2<U,T,U> op)
Produces a collection containing cummulative results of applying the
operator going left to right.
|
abstract <U> Function1<Function2<T,U,U>,Seq<U>> |
scanRight(U z)
Curried
scanRight(Object, Function2) |
abstract <U> Seq<U> |
scanRight(U z,
Function2<T,U,U> op)
Produces a collection containing cummulative results of applying the
operator going right to left.
|
abstract int |
size()
The size of this sequence, equivalent to length.
|
abstract Seq<T> |
slice(int from,
int until)
Selects an interval of elements.
|
abstract Seq<Seq<T>> |
sliding(int size)
Groups elements in fixed size blocks by passing a "sliding window" over
them (as opposed to partitioning them, as is done in grouped.
|
abstract Seq<Seq<T>> |
sliding(int size,
int step)
Groups elements in fixed size blocks by passing a "sliding window" over
them (as opposed to partitioning them, as is done in grouped.
|
abstract Seq<T> |
sortWith(Function2<T,T,Boolean> lt)
Sorts this sequence according to a comparison function.
|
abstract Tuple2<Seq<T>,Seq<T>> |
span(Function1<T,Boolean> p)
Splits this sequence into a prefix/suffix pair according to a predicate.
|
abstract Tuple2<Seq<T>,Seq<T>> |
splitAt(int n)
Splits this sequence into two at a given position.
|
abstract boolean |
startsWith(Seq<T> that)
Tests whether this sequence contains the given sequence at a given index.
|
abstract boolean |
startsWith(Seq<T> that,
int offset)
Tests whether this sequence contains the given sequence at a given index.
|
abstract SNum |
sum()
Sums up the elements of this collection.
|
abstract Seq<T> |
tail()
Selects all elements except the first.
|
abstract Seq<T> |
take(int n)
Selects first n elements.
|
abstract Seq<T> |
takeRight(int n)
Selects last n elements.
|
abstract Seq<T> |
takeWhile(Function1<T,Boolean> p)
Takes longest prefix of elements that satisfy a predicate.
|
abstract Seq<T> |
transpose()
Transposes this list of traversable collections into a list of lists.
|
abstract Seq<T> |
union(Seq<T> that)
Produces a new sequence which contains all elements of this sequence and
also all elements of a given sequence.
|
abstract Seq<T> |
updated(int index,
T elem)
A copy of this sequence with one single replaced element.
|
abstract <U> Seq<Tuple2<T,U>> |
zip(Seq<U> that)
Returns a sequence formed from this sequence and another iterable
collection by combining corresponding elements in pairs.
|
abstract Seq<Tuple2<T,Integer>> |
zipWithIndex()
Zips this sequence with its indices.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforeach, isEmpty, toListpublic static <T> Seq<T> apply(T... values)
public static <T> Seq<T> apply(Enumeration<T> e)
protected static <T> Seq<T> applyCollection(Collection<T> col)
public abstract Seq<T> append(T... that)
public abstract boolean contains(T elem)
public abstract <U> boolean corresponds(Seq<U> that, Function2<T,U,Boolean> p)
public abstract <U> Function1<Function2<T,U,Boolean>,Boolean> corresponds(Seq<U> that)
corresponds(Seq)public abstract int count(Function1<T,Boolean> p)
public abstract Seq<T> diff(Seq<T> that)
public abstract Seq<T> distinct()
public abstract Seq<T> dropWhile(Function1<T,Boolean> p)
public abstract boolean endsWith(Seq<T> that)
public abstract boolean exists(Function1<T,Boolean> p)
public abstract Seq<T> filter(Function1<T,Boolean> f)
public abstract Seq<T> filterNot(Function1<T,Boolean> f)
public abstract Option<T> find(Function1<T,Boolean> p)
public abstract <U> Seq<U> flatMap(Function1<T,CollectionLike<U>> f)
public abstract <U> U foldLeft(U z,
Function2<U,T,U> op)
public abstract <U> Function1<Function2<U,T,U>,U> foldLeft(U z)
foldLeft(Object, Function2)public abstract <U> U foldRight(U z,
Function2<T,U,U> op)
public abstract <U> Function1<Function2<T,U,U>,U> foldRight(U z)
foldRight(Object, Function2)public abstract boolean forall(Function1<T,Boolean> p)
public abstract <U> SMap<U,Seq<T>> groupBy(Function1<T,U> f)
public abstract T head()
public abstract int indexOf(T elem)
public abstract Seq<T> intersect(Seq<T> that)
public abstract boolean isDefinedAt(int idx)
public abstract T last()
public abstract <U> Seq<U> map(Function1<T,U> f)
public abstract SNum max()
public abstract SNum min()
public abstract String mkString()
public abstract String mkString(String sep)
public abstract String mkString(String start, String sep, String end)
public abstract Seq<T> padTo(int len, T elem)
public abstract Tuple2<Seq<T>,Seq<T>> partition(Function1<T,Boolean> p)
public abstract Seq<T> patch(int from, Seq<T> patch, int replaced)
public abstract <U> U reduceLeft(Function2<U,T,U> op)
public abstract <U> Option<U> reduceLeftOption(Function2<U,T,U> op)
public abstract <U> U reduceRight(Function2<T,U,U> op)
public abstract <U> Option<U> reduceRightOption(Function2<T,U,U> op)
public abstract <U> Seq<U> reverseMap(Function1<T,U> f)
public abstract boolean sameElements(Seq<T> that)
public abstract <U> Seq<U> scanLeft(U z, Function2<U,T,U> op)
public abstract <U> Function1<Function2<U,T,U>,Seq<U>> scanLeft(U z)
scanLeft(Object, Function2)public abstract <U> Seq<U> scanRight(U z, Function2<T,U,U> op)
public abstract <U> Function1<Function2<T,U,U>,Seq<U>> scanRight(U z)
scanRight(Object, Function2)public abstract int size()
public abstract Seq<Seq<T>> sliding(int size)
public abstract Seq<Seq<T>> sliding(int size, int step)
public abstract Seq<T> sortWith(Function2<T,T,Boolean> lt)
public abstract Tuple2<Seq<T>,Seq<T>> span(Function1<T,Boolean> p)
public abstract Tuple2<Seq<T>,Seq<T>> splitAt(int n)
public abstract boolean startsWith(Seq<T> that)
public abstract boolean startsWith(Seq<T> that, int offset)
public abstract SNum sum()
public abstract Seq<T> takeWhile(Function1<T,Boolean> p)
public abstract Seq<T> transpose()
public abstract Seq<T> union(Seq<T> that)
public abstract Seq<T> updated(int index, T elem)
public abstract <U> Seq<Tuple2<T,U>> zip(Seq<U> that)
Copyright © 2015. All rights reserved.