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 aMeter.Collection
.Declaration
Swift
public init(offset: Fraction = .zero)
-
Adds the given
element
to theintermediate
with accumulating offsets.Declaration
Swift
@discardableResult public func add(_ element: Meter) -> MeterCollectionBuilder
Return Value
Self
. -
Adds each of the given
elements
to theintermediate
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 theintermediate
.Declaration
Swift
public func build() -> Product