Modifier and Type | Method and Description |
---|---|
MSeq<T> |
copy()
Return a shallow copy of this sequence.
|
<B> ISeq<B> |
map(Function<? super T,? extends B> mapper)
Builds a new sequence by applying a function to all elements of this
sequence.
|
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. |
<A> ISeq<A> |
upcast(ISeq<? extends A> seq)
Deprecated.
Will be removed in the next version.
|
asList, contains, equals, forall, forAll, foreach, forEach, get, hashCode, indexOf, indexOf, indexOf, indexWhere, indexWhere, indexWhere, iterator, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, lastIndexWhere, length, toArray, toArray, toString, toString
ISeq<T> subSeq(int start, int end)
Seq
start
, 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
sort 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)
Seq
start
, 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
sort 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)
Seq
map
in interface Seq<T>
B
- the element type of the returned collection.mapper
- the function to apply to each element.@Deprecated <A> ISeq<A> upcast(ISeq<? extends A> seq)
Helper method for up-casting an given immutable sequence. This allows you
to assign this sequence to an sequence where the element type is a super
type of T
.
ISeq<Double> da = new Array<Double>(0.0, 1.0, 2.0).toISeq();
ISeq<Number> na = da.upcast(da);
ISeq<Object> oa = na.upcast(na);
seq
- the sequence to cast.© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)