public class Nil<T> extends Seq<T>
Seq implementation| Modifier and Type | Method and Description |
|---|---|
Seq<T> |
append(T... that)
[Original] Appends the passed elements
This method is similar to scala.collectoin.Seq#+:(A)
|
static <T> Nil<T> |
apply() |
boolean |
contains(T elem)
Tests whether this sequence contains a given value as an element.
|
<U> Function1<Function2<T,U,Boolean>,Boolean> |
corresponds(Seq<U> that)
Curried
Seq.corresponds(Seq) |
<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.
|
int |
count(Function1<T,Boolean> p)
Counts the number of elements in the sequence which satisfy a predicate.
|
Seq<T> |
diff(Seq<T> that)
Computes the multiset difference between this sequence and another
sequence.
|
Seq<T> |
distinct()
Builds a new sequence from this sequence without any duplicate elements.
|
Seq<T> |
drop(int n)
Selects all elements except first n ones.
|
Seq<T> |
dropNull()
[Original] Drops null elements
|
Seq<T> |
dropRight(int n)
Selects all elements except last n ones.
|
Seq<T> |
dropWhile(Function1<T,Boolean> p)
Drops longest prefix of elements that satisfy a predicate.
|
boolean |
endsWith(Seq<T> that)
Tests whether this sequence ends with the given sequence.
|
boolean |
exists(Function1<T,Boolean> p)
Tests whether a predicate holds for some of the elements of this
sequence.
|
Seq<T> |
filter(Function1<T,Boolean> f)
Selects all elements of this sequence which satisfy a predicate.
|
Seq<T> |
filterNot(Function1<T,Boolean> f)
Selects all elements of this immutable sequence which do not satisfy a
predicate.
|
Option<T> |
find(Function1<T,Boolean> p)
Finds the first element of the sequence satisfying a predicate, if any.
|
<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.
|
<U> Function1<Function2<U,T,U>,U> |
foldLeft(U z)
Curried
Seq.foldLeft(Object, Function2) |
<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.
|
<U> Function1<Function2<T,U,U>,U> |
foldRight(U z)
Curried
Seq.foldRight(Object, Function2) |
<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.
|
boolean |
forall(Function1<T,Boolean> p)
Tests whether a predicate holds for all elements of this sequence.
|
void |
foreach(VoidFunction1<T> f)
Applies a function f to all elements of this sequence.
|
<U> SMap<U,Seq<T>> |
groupBy(Function1<T,U> f)
Partitions this sequence into a map of sequences according to some
discriminator function.
|
T |
head()
Selects the first element of this sequence.
|
Option<T> |
headOption()
Optionally selects the first element.
|
int |
indexOf(T elem)
Finds index of first occurrence of some value in this sequence after or
at some start index.
|
Seq<Integer> |
indices()
Produces the range of all indices of this sequence.
|
Seq<T> |
init()
Selects all elements except the last.
|
Seq<T> |
intersect(Seq<T> that)
Computes the multiset intersection between this sequence and another
sequence.
|
boolean |
isDefinedAt(int idx)
Tests whether this sequence contains given index.
|
boolean |
isEmpty()
Tests whether the sequence is empty.
|
T |
last()
Selects the last element.
|
Option<T> |
lastOption()
Optionally selects the last element.
|
<U> Seq<U> |
map(Function1<T,U> f)
Builds a new collection by applying a function to all elements of this
sequence.
|
SNum |
max()
Finds the largest element.
|
SNum |
min()
Finds the smallest element.
|
String |
mkString()
Displays all elements of this sequence in a string.
|
String |
mkString(String sep)
Displays all elements of this sequence in a string using a separator
string.
|
String |
mkString(String start,
String sep,
String end)
Displays all elements of this sequence in a string using start, end, and
separator strings.
|
Seq<T> |
padTo(int len,
T elem)
Appends an element value to this sequence until a given target length is
reached.
|
ParSeq<T> |
par()
Returns a parallel implementation of this collection.
|
Tuple2<Seq<T>,Seq<T>> |
partition(Function1<T,Boolean> p)
Partitions this sequence in two sequences according to a predicate.
|
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.
|
<U> U |
reduceLeft(Function2<U,T,U> op)
Applies a binary operator to all elements of this immutable sequence,
going left to right.
|
<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.
|
<U> U |
reduceRight(Function2<T,U,U> op)
Applies a binary operator to all elements of this immutable sequence,
going right to left.
|
<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.
|
Seq<T> |
reverse()
Returns new sequence wih elements in reversed order.
|
<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.
|
boolean |
sameElements(Seq<T> that)
Checks if the other iterable collection contains the same elements in the
same order as this sequence.
|
<U> Function1<Function2<U,T,U>,Seq<U>> |
scanLeft(U z)
Curried
Seq.scanLeft(Object, Function2) |
<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.
|
<U> Function1<Function2<T,U,U>,Seq<U>> |
scanRight(U z)
Curried
Seq.scanRight(Object, Function2) |
<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.
|
int |
size()
The size of this sequence, equivalent to length.
|
Seq<T> |
slice(int from,
int until)
Selects an interval of elements.
|
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.
|
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.
|
Seq<T> |
sortWith(Function2<T,T,Boolean> lt)
Sorts this sequence according to a comparison function.
|
Tuple2<Seq<T>,Seq<T>> |
span(Function1<T,Boolean> p)
Splits this sequence into a prefix/suffix pair according to a predicate.
|
Tuple2<Seq<T>,Seq<T>> |
splitAt(int n)
Splits this sequence into two at a given position.
|
boolean |
startsWith(Seq<T> that)
Tests whether this sequence contains the given sequence at a given index.
|
boolean |
startsWith(Seq<T> that,
int offset)
Tests whether this sequence contains the given sequence at a given index.
|
SNum |
sum()
Sums up the elements of this collection.
|
Seq<T> |
tail()
Selects all elements except the first.
|
Seq<T> |
take(int n)
Selects first n elements.
|
Seq<T> |
takeRight(int n)
Selects last n elements.
|
Seq<T> |
takeWhile(Function1<T,Boolean> p)
Takes longest prefix of elements that satisfy a predicate.
|
List<T> |
toList()
[Original] Produces as java.util.List object
|
String |
toString() |
Seq<T> |
transpose()
Transposes this list of traversable collections into a list of lists.
|
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.
|
Seq<T> |
updated(int index,
T elem)
A copy of this sequence with one single replaced element.
|
<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.
|
Seq<Tuple2<T,Integer>> |
zipWithIndex()
Zips this sequence with its indices.
|
public static <T> Nil<T> apply()
public List<T> toList()
CollectionLikepublic boolean isEmpty()
CollectionLikepublic <U> Seq<U> map(Function1<T,U> f)
Seqpublic void foreach(VoidFunction1<T> f)
CollectionLikepublic Seq<T> filter(Function1<T,Boolean> f)
Seqpublic <U> Seq<U> flatMap(Function1<T,CollectionLike<U>> f)
Seqpublic Option<T> headOption()
SeqheadOption in class Seq<T>public Option<T> lastOption()
SeqlastOption in class Seq<T>public String mkString()
Seqpublic String mkString(String sep)
Seqpublic String mkString(String start, String sep, String end)
Seqpublic Seq<T> sortWith(Function2<T,T,Boolean> lt)
Seqpublic <U> U foldLeft(U z,
Function2<U,T,U> op)
Seqpublic <U> Function1<Function2<U,T,U>,U> foldLeft(U z)
SeqSeq.foldLeft(Object, Function2)public <U> U foldRight(U z,
Function2<T,U,U> op)
Seqpublic <U> Function1<Function2<T,U,U>,U> foldRight(U z)
SeqSeq.foldRight(Object, Function2)public <U> Function1<Function2<T,U,Boolean>,Boolean> corresponds(Seq<U> that)
SeqSeq.corresponds(Seq)corresponds in class Seq<T>public <U> boolean corresponds(Seq<U> that, Function2<T,U,Boolean> p)
Seqcorresponds in class Seq<T>public Seq<T> distinct()
Seqpublic int size()
Seqpublic <U> SMap<U,Seq<T>> groupBy(Function1<T,U> f)
Seqpublic Seq<Tuple2<T,Integer>> zipWithIndex()
SeqzipWithIndex in class Seq<T>public Option<T> find(Function1<T,Boolean> p)
Seqpublic Tuple2<Seq<T>,Seq<T>> partition(Function1<T,Boolean> p)
Seqpublic Tuple2<Seq<T>,Seq<T>> splitAt(int n)
Seqpublic Seq<T> reverse()
Seqpublic Seq<T> slice(int from, int until)
Seqpublic Seq<Seq<T>> sliding(int size)
Seqpublic Seq<Seq<T>> sliding(int size, int step)
Seqpublic Tuple2<Seq<T>,Seq<T>> span(Function1<T,Boolean> p)
Seqpublic Seq<T> takeRight(int n)
Seqpublic Seq<T> takeWhile(Function1<T,Boolean> p)
Seqpublic boolean exists(Function1<T,Boolean> p)
Seqpublic boolean forall(Function1<T,Boolean> p)
Seqpublic int count(Function1<T,Boolean> p)
Seqpublic Seq<T> drop(int n)
Seqpublic Seq<T> dropRight(int n)
Seqpublic Seq<T> dropWhile(Function1<T,Boolean> p)
Seqpublic <U> Seq<Tuple2<T,U>> zip(Seq<U> that)
Seqpublic boolean contains(T elem)
Seqpublic Seq<T> diff(Seq<T> that)
Seqpublic boolean startsWith(Seq<T> that)
SeqstartsWith in class Seq<T>public boolean startsWith(Seq<T> that, int offset)
SeqstartsWith in class Seq<T>public boolean endsWith(Seq<T> that)
Seqpublic int indexOf(T elem)
Seqpublic boolean isDefinedAt(int idx)
SeqisDefinedAt in class Seq<T>public Seq<Integer> indices()
Seqpublic <U> Seq<U> reverseMap(Function1<T,U> f)
SeqreverseMap in class Seq<T>public Seq<T> patch(int from, Seq<T> patch, int replaced)
Seqpublic Seq<T> updated(int index, T elem)
Seqpublic Seq<T> union(Seq<T> that)
Seqpublic boolean sameElements(Seq<T> that)
SeqsameElements in class Seq<T>public Seq<T> intersect(Seq<T> that)
Seqpublic Seq<T> padTo(int len, T elem)
Seqpublic <U> Seq<U> scanLeft(U z, Function2<U,T,U> op)
Seqpublic <U> Function1<Function2<U,T,U>,Seq<U>> scanLeft(U z)
SeqSeq.scanLeft(Object, Function2)public <U> Seq<U> scanRight(U z, Function2<T,U,U> op)
Seqpublic <U> Function1<Function2<T,U,U>,Seq<U>> scanRight(U z)
SeqSeq.scanRight(Object, Function2)public Seq<T> filterNot(Function1<T,Boolean> f)
Seqpublic Seq<T> append(T... that)
Seqpublic <U> U reduceLeft(Function2<U,T,U> op)
SeqreduceLeft in class Seq<T>public <U> Option<U> reduceLeftOption(Function2<U,T,U> op)
SeqreduceLeftOption in class Seq<T>public <U> U reduceRight(Function2<T,U,U> op)
SeqreduceRight in class Seq<T>public <U> Option<U> reduceRightOption(Function2<T,U,U> op)
SeqreduceRightOption in class Seq<T>public ParSeq<T> par()
SeqCopyright © 2015. All rights reserved.