ContiguousSegmentCollection
-
A generic collection of contiguous
Intervallic-type value whereinIntervallictypes are stored by their offset.Example Usage
let collection: ContiguousSegmentCollection = [1,2,1,3]This creates a
ContiguousSegmentCollection<Int>, where theMetricandIntervallictypes are bothInt. Each segment is the length of a given value, and is stored by the accumulating offset.The resulting structure could be represented like this:
See moreoffset: 0 1 3 4 7 |-|--|-|---| length: 1 2 1 3Declaration
Swift
public struct ContiguousSegmentCollection <Segment: Intervallic> where Segment.Metric: Hashable & Additiveextension ContiguousSegmentCollection: Intervallicextension ContiguousSegmentCollection: RandomAccessCollectionWrappingextension ContiguousSegmentCollection: ExpressibleByArrayLiteralextension ContiguousSegmentCollection: CustomStringConvertibleextension ContiguousSegmentCollection: Fragmentable where Metric: Zero, Segment: IntervallicFragmentable, Segment.Fragment: IntervallicFragmentable, Segment.Fragment.Fragment == Segment.Fragmentextension ContiguousSegmentCollection: Equatable where Segment: Equatableextension ContiguousSegmentCollection: Hashable where Segment: Hashable -
Interface for types which are measured by some
See moreMetrictype.Declaration
Swift
public protocol Measured -
Interface for types which can be fragmented into smaller pieces.
See moreDeclaration
Swift
public protocol Fragmentable -
Interface for fragment types which can create a fragment version of a whole instance of the type.
See moreDeclaration
Swift
public protocol Totalizable -
Interface for types which are
See moreIntervallic, and can be fragmented into a type which shares itsMetrictype.Declaration
Swift
public protocol IntervallicFragmentable: Intervallic, Fragmentable where Fragment: Intervallic, Fragment.Metric == Metric
View on GitHub
Install in Dash
ContiguousSegmentCollection Reference