Selects an element by its index in the $coll.
Selects an element by its index in the $coll.
The index to select.
the element of this $coll at index idx
, where 0
indicates the first element.
if idx
does not satisfy 0 <= idx < length
.
Tests whether this $coll contains a given sequence as a slice.
Tests whether this $coll contains a given sequence as a slice. $mayNotTerminateInf
the sequence to test
true
if this $coll contains a slice with the same elements
as that
, otherwise false
.
Tests whether this $coll contains a given sequence as a slice.
Tests whether this $coll contains a given sequence as a slice. $mayNotTerminateInf
the sequence to test
true
if this $coll contains a slice with the same elements
as that
, otherwise false
.
Tests whether every element of this $coll relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this $coll relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this $coll
and y
of that
, otherwise false
.
Tests whether every element of this $coll relates to the corresponding element of another sequence by satisfying a test predicate.
Tests whether every element of this $coll relates to the corresponding element of another sequence by satisfying a test predicate.
the type of the elements of that
the other sequence
the test predicate, which relates elements from both sequences
true
if both sequences have the same length and
p(x, y)
is true
for all corresponding elements x
of this $coll
and y
of that
, otherwise false
.
Partitions the data into fixed size blocks (same as sliding(size,size).
Partitions the data into fixed size blocks (same as sliding(size,size).
the number of elements per group
An LongTraversable producing Seqs of size size
, except the
last and the only element will be truncated if there are
fewer elements than size.
[use case]
the element value to search for.
the start index
the index >= from
of the first element of this $coll that is equal (wrt ==
)
to elem
, or -1
, if none exists.
[use case]
the element value to search for.
the index of the first element of this $coll that is equal (wrt ==
)
to elem
, or -1
, if none exists.
Finds first index after or at a start index where this $coll contains a given sequence as a slice.
Finds first index after or at a start index where this $coll contains a given sequence as a slice. $mayNotTerminateInf
the sequence to test
the start index
the first index >= from
such that the elements of this $coll starting at this index
match the elements of sequence that
, or -1
of no such subsequence exists.
Finds first index where this $coll contains a given sequence as a slice.
Finds first index where this $coll contains a given sequence as a slice. $mayNotTerminateInf
the sequence to test
the first index such that the elements of this $coll starting at this index
match the elements of sequence that
, or -1
of no such subsequence exists.
Finds index of the first element satisfying some predicate after or at some start index.
Finds index of the first element satisfying some predicate after or at some start index.
$mayNotTerminateInf
the predicate used to test elements.
the start index
the index >= from
of the first element of this $coll that satisfies the predicate p
,
or -1
, if none exists.
[use case]
the element value to search for.
the end index.
the index <= end
of the last element of this $coll that is equal (wrt ==
)
to elem
, or -1
, if none exists.
[use case]
the element value to search for.
the index of the last element of this $coll that is equal (wrt ==
)
to elem
, or -1
, if none exists.
Finds index of last element satisfying some predicate before or at given end index.
Finds index of last element satisfying some predicate before or at given end index.
Always takes linear time and traverses entire traversal
the predicate used to test elements.
the index <= end
of the last element of this $coll that satisfies the predicate p
,
or -1
, if none exists.
Finds index of last element satisfying some predicate.
Finds index of last element satisfying some predicate.
$willNotTerminateInf
the predicate used to test elements.
the index of the last element of this $coll that satisfies the predicate p
,
or -1
, if none exists.
The long equivalent of Traversable.
The long equivalent of Traversable.drop
A foldLeft operation that can be terminated without processing the entire collection.
A foldLeft operation that can be terminated without processing the entire collection.
Unlike a normal fold, the function passed to limitFold returns a scalax.io.FoldResult which both provides the value that is to be passed to the next stage of the fold as well as represents if the fold should continue or terminate.
the value to seed the operation with. IE the value that is passed as the accumulator for the first value of the fold operation
the operation that combines the current and previous versions. The input is the (acc,next) where acc is the result from the previous call and next is the next value in the collection to be processed. The return value of the op is Either scalax.io.Continue or scalax.io.End indicating if the process should continue to next element or terminate, returning the value contained in the result object
the last value contained in the scalax.io.FoldResult which was returned by op
The long equivalent of Traversable.
The long equivalent of Traversable.size
NOT recommended for use since it might trigger a full traversal of the traversable
The long equivalent of Traversable.
The long equivalent of Traversable.splitAt
The long equivalent of Traversable.
The long equivalent of Traversable.take
Returns the length of the longest prefix whose elements all satisfy some predicate.
Returns the length of the longest prefix whose elements all satisfy some predicate.
the predicate used to test elements.
the length of the longest prefix of this $coll
such that every element of the segment satisfies the predicate p
.
Create a processor that provides an API for declaring a processing pipeline of this LongTraversable in a very flexible way.
Create a processor that provides an API for declaring a processing pipeline of this LongTraversable in a very flexible way.
a processor for processing a LongTraversable
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Computes length of longest segment whose elements all satisfy some predicate.
Computes length of longest segment whose elements all satisfy some predicate.
the predicate used to test elements.
the index where the search starts.
the length of the longest segment of this $coll starting from index from
such that every element of the segment satisfies the predicate p
.
Groups elements in fixed size blocks by passing a "sliding window" over them.
Groups elements in fixed size blocks by passing a "sliding window" over them.
This is based on Iterator#sliding but does not return an iterator to ensure that a resource is not left open.
the number of elements per group
the distance between the first elements of successive groups (defaults to 1)
An LongTraversable producing Seqs of size size
, except the
last and the only element will be truncated if there are
fewer elements than size.
Tests whether this $coll starts with the given sequence.
Tests whether this $coll starts with the given sequence.
the sequence to test
true
if this collection has that
as a prefix, false
otherwise.
Tests whether this $coll contains the given sequence at a given index.
Tests whether this $coll contains the given sequence at a given index.
If the both the receiver object, this
and
the argument, that
are infinite sequences
this method may not terminate.
the sequence to test
the index where the sequence is searched.
true
if the sequence that
is contained in this $coll at index offset
,
otherwise false
.
Tests whether this $coll starts with the given sequence.
Tests whether this $coll starts with the given sequence.
the sequence to test
true
if this collection has that
as a prefix, false
otherwise.
Tests whether this $coll contains the given sequence at a given index.
Tests whether this $coll contains the given sequence at a given index.
If the both the receiver object, this
and
the argument, that
are infinite sequences
this method may not terminate.
the sequence to test
the index where the sequence is searched.
true
if the sequence that
is contained in this $coll at index offset
,
otherwise false
.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
Use the underlying iterator for this traversable.
Use the underlying iterator for this traversable.
if the iterator is returned
withIterator catches all exceptions and calls the error handler to handle the exceptions So exceptions must not be thrown in f as control flow exceptions.
,If the iterator is returned from this block an exception will be thrown because the iterator is invalid outside of this block and the behaviour is undefined
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs. If one of the two collections is longer than the other, its remaining elements are ignored.
the type of the second half of the returned pairs
The iterable providing the second half of each result pair
a new collection of type That
containing pairs consisting of
corresponding elements of this $coll and that
. The length
of the returned collection is the minimum of the lengths of this $coll and that
.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs. If one of the two collections is longer than the other, its remaining elements are ignored.
the type of the second half of the returned pairs
The iterable providing the second half of each result pair
a new collection of type That
containing pairs consisting of
corresponding elements of this $coll and that
. The length
of the returned collection is the minimum of the lengths of this $coll and that
.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.
$orderDependent
the type of the second half of the returned pairs
the iterable providing the second half of each result pair
the element to be used to fill up the result if this $coll is shorter than that
.
the element to be used to fill up the result if that
is shorter than this $coll.
a new collection of type That
containing pairs consisting of
corresponding elements of this $coll and that
. The length
of the returned collection is the maximum of the lengths of this $coll and that
.
If this $coll is shorter than that
, thisElem
values are used to pad the result.
If that
is shorter than this $coll, thatElem
values are used to pad the result.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs.
Returns a $coll formed from this $coll and another iterable collection by combining corresponding elements in pairs. If one of the two collections is shorter than the other, placeholder elements are used to extend the shorter collection to the length of the longer.
$orderDependent
the type of the second half of the returned pairs
the iterable providing the second half of each result pair
the element to be used to fill up the result if this $coll is shorter than that
.
the element to be used to fill up the result if that
is shorter than this $coll.
a new collection of type That
containing pairs consisting of
corresponding elements of this $coll and that
. The length
of the returned collection is the maximum of the lengths of this $coll and that
.
If this $coll is shorter than that
, thisElem
values are used to pad the result.
If that
is shorter than this $coll, thatElem
values are used to pad the result.
[use case]
A new $coll containing pairs consisting of all elements of this
$coll paired with their index. Indices start at 0
.
List("a", "b", "c").zipWithIndex = List(("a", 0), ("b", 1), ("c", 2))
resourceOpener must either be a InputStream or a ReadableByteChannel (or subclass). Anything else will throw an exception