MeterCollectionBuilder

public final class MeterCollectionBuilder

Stateful building of a Meter.Collection.

  • The end product of this Meter.Collection.Builder.

    Declaration

    Swift

    public typealias Product = Meter.Collection
  • The value which will ultimately be the underlying storage of a Meter.Collection.

    Declaration

    Swift

    public var intermediate: OrderedDictionary<Fraction, Meter>
  • The accumulating offset of Fraction keys.

    Declaration

    Swift

    public var offset: Fraction
  • Create an empty Meter.Collection.Builder ready to help you build up a Meter.Collection.

    Declaration

    Swift

    public init(offset: Fraction = .zero)
  • Adds the given element to the intermediate with accumulating offsets.

    Declaration

    Swift

    @discardableResult
    public func add(_ element: Meter) -> MeterCollectionBuilder

    Return Value

    Self.

  • Adds each of the given elements to the intermediate with accumulating offsets.

    Declaration

    Swift

    @discardableResult
    public func add <S: Sequence> (_ elements: S) -> Self
        where S.Element == Meter

    Return Value

    Self.

  • Creates the final Product with the intermediate.

    Declaration

    Swift

    public func build() -> Product