CPCCompoundCalendarUnit
internal protocol CPCCompoundCalendarUnit : CPCCalendarUnit, BidirectionalCollection where Self.Element : CPCCalendarUnit, Self.Index == CPCCompoundCalendarUnitIndex
Protocol, implementing a collection of smaller units that are contained in this calendar unit.
-
Calculate all possible indices for a given compound unit.
Declaration
Swift
static func indices(for value: BackingType, using calendar: Calendar) -> ContiguousArray<Int>Parameters
valueBacking value of a compound unit to perform calculations for.
calendarCalendar to perform calculations with.
Return Value
All indices that are valid for compound unit that contains a date represented by given
value. -
Undocumented
Declaration
Swift
var indicesCache: ContiguousArray<Int> { get } -
index(of:)Default implementationUndocumented
Default Implementation
Undocumented
Declaration
Swift
func index(of element: Element) -> Index? -
Undocumented
Declaration
Swift
func componentValue(of element: Element) -> Int
-
cachedElement(at:)Extension methodQuery calendar units cache for subunit of a compound calendar unit.
Declaration
Swift
internal func cachedElement(at index: Index) -> Element?Parameters
indexIndex of queried subunit.
Return Value
Subunit at
indexths place of this unit or nil if no such value was previously cached. -
cacheElement(_:for:)Extension methodCache a calendar subunit for specified position in this unit.
Declaration
Swift
internal func cacheElement(_ element: Element, for index: Index)Parameters
elementSubunit that is being cached.
indexIndex of cached subunit.
-
cachedIndex(of:)Extension methodQuery calendar units cache for position of subunit in this one.
Declaration
Swift
internal func cachedIndex(of element: Element) -> Index?Parameters
elementSubunit, index of which is requested.
Return Value
Index of given subunit or nil if no such value was previously cached.
-
cacheIndex(_:for:)Extension methodCache position of a subunit inside this one.
Declaration
Swift
internal func cacheIndex(_ index: Index, for element: Element)Parameters
indexPosition of given subunit that is being cached.
elementSubunit to cache index for.
-
countExtension methodDeclaration
Swift
@inlinable public var count: Int { get } -
startIndexExtension methodUndocumented
Declaration
Swift
@inlinable public var startIndex: Index { get } -
endIndexExtension methodUndocumented
Declaration
Swift
@inlinable public var endIndex: Index { get } -
index(after:)Extension methodUndocumented
Declaration
Swift
@inlinable public func index(after i: Index) -> Index -
index(before:)Extension methodDeclaration
Swift
@inlinable public func index(before i: Index) -> Index -
firstIndex(of:)Extension methodUndocumented
Declaration
Swift
@inlinable public func firstIndex(of element: Element) -> Index? -
lastIndex(of:)Extension methodUndocumented
Declaration
Swift
@inlinable public func lastIndex(of element: Element) -> Index? -
distance(from:to:)Extension methodUndocumented
Declaration
Swift
@inlinable public func distance(from start: Index, to end: Index) -> Int -
index(_:offsetBy:)Extension methodUndocumented
Declaration
Swift
@inlinable public func index(_ i: Index, offsetBy distance: Int) -> Index -
index(ordinal:)Extension methodUndocumented
Declaration
Swift
@inlinable public func index(ordinal ordinalValue: Int) -> Index -
subscript(_:)Extension methodUndocumented
Declaration
Swift
@inlinable public subscript(position: Index) -> Element { get } -
subscript(ordinal:)Extension methodReturns a subunit at nth place using zero-based indexes.
Declaration
Swift
@inlinable public subscript(ordinal position: Int) -> Element { get }Parameters
positionZero-based index of subunit.
View on GitHub
Install in Dash
CPCCompoundCalendarUnit Protocol Reference