RandomAccessCollectionWrapping

public protocol RandomAccessCollectionWrapping : RandomAccessCollection

Interface for wrapping any RandomAccessCollection type. The RandomAccessCollection interface is exposed, regardless of the concrete implementation of the wrapped type.

The performance guarantees made by the RandomAccessCollection are sustained.

Associated Types

  • Wrapped RandomAccessCollection-conforming type.

    Declaration

    Swift

    associatedtype Base : RandomAccessCollection

Instance Properties

  • Wrapped RandomAccessCollection-conforming type.

    Declaration

    Swift

    var base: Base { get }

RandomAccessCollection

  • startIndex Extension method

    Start index.

    Complexity

    O(1)

    Declaration

    Swift

    public var startIndex: Base.Index { get }
  • endIndex Extension method

    End index.

    Complexity

    O(1)

    Declaration

    Swift

    public var endIndex: Base.Index { get }
  • first Extension method

    First element, if there is at least one element. Otherwise, nil.

    Complexity

    O(1)

    Declaration

    Swift

    public var first: Base.Element? { get }
  • last Extension method

    Last element, if there is at least one element. Otherwise, nil.

    Complexity

    O(1)

    Declaration

    Swift

    public var last: Base.Element? { get }
  • count Extension method

    Amount of elements.

    Complexity

    O(1)

    Declaration

    Swift

    public var count: Int { get }
  • isEmpty Extension method

    Complexity

    O(1)

    Declaration

    Swift

    public var isEmpty: Bool { get }

    Return Value

    true if there are no elements contained herein. Otherwise, false.

  • subscript(_:) Extension method

    Complexity

    O(1)

    Declaration

    Swift

    public subscript(position: Base.Index) -> Base.Element { get }

    Return Value

    The element at the given index.

  • index(after:) Extension method

    Complexity

    O(1)

    Declaration

    Swift

    public func index(after index: Base.Index) -> Base.Index

    Return Value

    Index after the given index.

  • index(before:) Extension method

    Complexity

    O(1)

    Declaration

    Swift

    public func index(before index: Base.Index) -> Base.Index

    Return Value

    Index before the given index.