| Modifier and Type | Field and Description |
|---|---|
static ISeq<?> |
EMPTY
Single instance of an empty
ISeq. |
| Modifier and Type | Method and Description |
|---|---|
ISeq<T> |
append(Iterable<? extends T> values)
Return a new
Seq with the given values appended. |
default ISeq<T> |
append(T... values)
Return a new
Seq with the given values appended. |
static <T> ISeq<T> |
concat(ISeq<? extends T> a,
ISeq<? extends T> b)
Return a sequence whose elements are all the elements of the first
sequence followed by all the elements of the second sequence.
|
static <T> ISeq<T> |
concat(ISeq<? extends T> a,
T... b)
Return a sequence whose elements are all the elements of the first
sequence followed by all the elements of the vararg array.
|
static <T> ISeq<T> |
concat(T a,
ISeq<? extends T> b)
Return a sequence whose elements are all the elements of the first
element followed by all the elements of the sequence.
|
MSeq<T> |
copy()
Return a shallow copy of this sequence.
|
static <T> ISeq<T> |
empty()
Return an empty
ISeq. |
<B> ISeq<B> |
map(Function<? super T,? extends B> mapper)
Builds a new sequence by applying a function to all elements of this
sequence.
|
static <T> ISeq<T> |
of(Iterable<? extends T> values)
Create a new
ISeq from the given values. |
static <T> ISeq<T> |
of(Supplier<? extends T> supplier,
int length)
Creates a new sequence, which is filled with objects created be the given
supplier. |
static <T> ISeq<T> |
of(T... values)
Create a new
ISeq from the given values. |
ISeq<T> |
prepend(Iterable<? extends T> values)
Return a new
Seq with the given values prepended. |
default ISeq<T> |
prepend(T... values)
Return a new
Seq with the given values prepended. |
ISeq<T> |
subSeq(int start)
Returns a view of the portion of this sequence between the specified
start, inclusive, and end, exclusive. |
ISeq<T> |
subSeq(int start,
int end)
Returns a view of the portion of this sequence between the specified
start, inclusive, and end, exclusive. |
static <T> Collector<T,?,ISeq<T>> |
toISeq()
Returns a
Collector that accumulates the input elements into a
new ISeq. |
static <T> Collector<T,?,ISeq<T>> |
toISeq(int maxSize)
Returns a
Collector that accumulates the last n input
elements into a new ISeq. |
static <A,B extends A> |
upcast(ISeq<B> seq)
Allows a safe (without compile warning) upcast from
B to
A. |
apply, asISeq, asList, asMSeq, concat, concat, concat, contains, equals, equals, forAll, get, hashCode, hashCode, indexOf, indexOf, indexOf, indexWhere, indexWhere, indexWhere, isEmpty, isSorted, isSorted, iterator, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, lastIndexWhere, length, listIterator, nonEmpty, parallelStream, size, spliterator, stream, toArray, toArray, toArray, toSeq, toSeq, toString, toString, viewOf, viewOfISeq<T> subSeq(int start, int end)
Seqstart, inclusive, and end, exclusive. (If start
and end are equal, the returned sequence has the length zero.)
The returned sequence is backed by this sequence, so non-structural
changes in the returned sequence are reflected in this array, and
vice-versa.
This method eliminates the need for explicit range operations (of the populationSort that commonly exist for arrays). Any operation that expects an array can be used as a range operation by passing an sub sequence view instead of an whole sequence.
ISeq<T> subSeq(int start)
Seqstart, inclusive, and end, exclusive. (If start
and end are equal, the returned sequence has the length zero.)
The returned sequence is backed by this sequence, so non-structural
changes in the returned sequence are reflected in this sequence, and
vice-versa.
This method eliminates the need for explicit range operations (of the populationSort that commonly exist for arrays). Any operation that expects an sequence can be used as a range operation by passing an sub sequence view instead of an whole sequence.
<B> ISeq<B> map(Function<? super T,? extends B> mapper)
Seqmap in interface Seq<T>B - the element type of the returned collection.mapper - the function to apply to each element.default ISeq<T> append(T... values)
SeqSeq with the given values appended.ISeq<T> append(Iterable<? extends T> values)
SeqSeq with the given values appended.default ISeq<T> prepend(T... values)
SeqSeq with the given values prepended.ISeq<T> prepend(Iterable<? extends T> values)
SeqSeq with the given values prepended.static <T> ISeq<T> concat(T a, ISeq<? extends T> b)
T - the type of the sequence elementsa - the first elementb - the appending sequenceNullPointerException - if one of the second arguments is
nullstatic <T> ISeq<T> concat(ISeq<? extends T> a, T... b)
T - the type of the sequence elementsa - the first sequenceb - the vararg elementsNullPointerException - if one of the arguments is nullstatic <T> ISeq<T> concat(ISeq<? extends T> a, ISeq<? extends T> b)
T - the type of the sequence elementsa - the first sequenceb - the second sequenceNullPointerException - if one of the arguments is nullstatic <T> Collector<T,?,ISeq<T>> toISeq()
Collector that accumulates the input elements into a
new ISeq.T - the type of the input elementsCollector which collects all the input elements into an
ISeq, in encounter orderstatic <T> Collector<T,?,ISeq<T>> toISeq(int maxSize)
Collector that accumulates the last n input
elements into a new ISeq.T - the type of the input elementsmaxSize - the maximal size of the collected sequenceCollector which collects maximal maxSize of the
input elements into an ISeq, in encounter orderIllegalArgumentException - if the maxSize is negative@SafeVarargs static <T> ISeq<T> of(T... values)
ISeq from the given values.of in interface Seq<T>T - the element typevalues - the array values.ISeq with the given values.NullPointerException - if the values array is null.static <T> ISeq<T> of(Iterable<? extends T> values)
ISeq from the given values.of in interface Seq<T>T - the element typevalues - the array values.ISeq with the given values.NullPointerException - if the values array is null.static <T> ISeq<T> of(Supplier<? extends T> supplier, int length)
supplier.of in interface Seq<T>T - the element type of the sequencesupplier - the Supplier which creates the elements, the
returned sequence is filled withlength - the length of the returned sequencesupplierNegativeArraySizeException - if the given length is
negativeNullPointerException - if the given supplier is
nullstatic <A,B extends A> ISeq<A> upcast(ISeq<B> seq)
B to
A. Since ISeq instances are immutable, an upcast
will be always safe.
// The sequence which we want to case.
final ISeq<? extends Number> ints = ISeq.of(1, 2, 3, 4, 5);
// This casts are possible without warning.
final ISeq<Object> objects = ISeq.upcast(ints);
final ISeq<Number> numbers = ISeq.upcast(ints);
// This cast will, of course, still fail.
final ISeq<String> strings = ISeq.upcast(ints);
final ISeq<Integer> integers = ISeq.upcast(ints);A - the super-object typeB - the sub-object typeseq - the sequence to cast safelyseq© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)