ContiguousSegmentCollection

  • A generic collection of contiguous Intervallic-type value wherein Intervallic types are stored by their offset.

    Example Usage

    let collection: ContiguousSegmentCollection = [1,2,1,3]
    

    This creates a ContiguousSegmentCollection<Int>, where the Metric and Intervallic types are both Int. Each segment is the length of a given value, and is stored by the accumulating offset.

    The resulting structure could be represented like this:

    offset: 0 1  3 4   7
            |-|--|-|---|
    length:  1  2 1  3
    
    See more

    Declaration

    Swift

    public struct ContiguousSegmentCollection <Segment: Intervallic>
        where Segment.Metric: Hashable & Additive
    extension ContiguousSegmentCollection: Intervallic
    extension ContiguousSegmentCollection: RandomAccessCollectionWrapping
    extension ContiguousSegmentCollection: ExpressibleByArrayLiteral
    extension ContiguousSegmentCollection: CustomStringConvertible
    extension ContiguousSegmentCollection: Fragmentable where
        Metric: Zero,
        Segment: IntervallicFragmentable,
        Segment.Fragment: IntervallicFragmentable,
        Segment.Fragment.Fragment == Segment.Fragment
    extension ContiguousSegmentCollection: Equatable where Segment: Equatable
    extension ContiguousSegmentCollection: Hashable where Segment: Hashable
  • Interface for types which are measured by some Metric type.

    See more

    Declaration

    Swift

    public protocol Measured
  • Undocumented

    See more

    Declaration

    Swift

    public protocol Intervallic : Measured
  • Interface for types which can be fragmented into smaller pieces.

    See more

    Declaration

    Swift

    public protocol Fragmentable
  • Interface for fragment types which can create a fragment version of a whole instance of the type.

    See more

    Declaration

    Swift

    public protocol Totalizable
  • Interface for types which are Intervallic, and can be fragmented into a type which shares its Metric type.

    See more

    Declaration

    Swift

    public protocol IntervallicFragmentable: Intervallic, Fragmentable
        where Fragment: Intervallic, Fragment.Metric == Metric