struct
LazyBidirectionalCollection
<
S
:
CollectionType
where
S
.
Index
:
BidirectionalIndexType
>
Inheritance |
CollectionType, SequenceType, _CollectionType, _SequenceType, _Sequence_Type
View Protocol Hierarchy →
|
---|---|
Associated Types |
Type alias inferred.
Type alias inferred.
Type alias inferred.
Type alias inferred. |
Import |
|
Initializers
Construct an instance with base
as its underlying collection
instance.
Declaration
init
(
_
base
:
S
)
Instance Variables
an Array, created on-demand, containing the elements of this lazy CollectionType.
Declaration
var
array
: [
S
.
Generator
.
Element
] {
get
}
The collection's "past the end" position.
endIndex
is not a valid argument to subscript
, and is always
reachable from startIndex
by zero or more applications of
successor()
.
Declaration
var
endIndex
:
S
.
Index
{
get
}
The first element, or nil
if self
is empty
Declaration
var
first
:
S
.
Generator
.
Element
? {
get
}
The last element, or nil
if self
is empty
Declaration
var
last
:
S
.
Generator
.
Element
? {
get
}
The position of the first element in a non-empty collection.
Identical to endIndex
in an empty collection.
Declaration
var
startIndex
:
S
.
Index
{
get
}
Subscripts
Declaration
subscript
(
position
:
S
.
Index
) -
>
S
.
Generator
.
Element
{
get
}
Instance Methods
Return a lazy SequenceType containing the elements x
of source
for
which includeElement(x)
is true
Declaration
func
filter
(
includeElement
: (
S
.
Generator
.
Element
) -
>
Bool
) -
>
LazySequence
<
FilterSequenceView
<
S
>
>
Return a generator over the elements of this sequence.
Complexity: O(1)
Declaration
func
generate
() -
>
S
.
Generator
Return a MapCollectionView
over this LazyBidirectionalCollection
. The elements of
the result are computed lazily, each time they are read, by
calling transform
function on a base element.
Declaration
func
map
<
U
>
(
transform
: (
S
.
Generator
.
Element
) -
>
U
) -
>
LazyBidirectionalCollection
<
MapCollectionView
<
S
,
U
>
>
Return a BidirectionalReverseView
over this LazyBidirectionalCollection
. The elements of
the result are computed lazily, each time they are read, by
calling transform
function on a base element.
Declaration
func
reverse
() -
>
LazyBidirectionalCollection
<
BidirectionalReverseView
<
S
>
>
A collection that forwards its implementation to an underlying collection instance while exposing lazy computations as methods.