Cardinality
public struct Cardinality : Equatable
Represents the cardinality of a rule. It can be specified as a closed range,
including those with no upper bound (PartialRangeFrom
)
-
The minimum number of matches, must be >= 0
Declaration
Swift
public let minimumMatches: Int
-
The maximum number of matches. If nil, any number can be matched
Declaration
Swift
public let maximumMatches: Int?
-
Creates a new range from the supplied partial range meaning that the number of allowable matches is infinite
Declaration
Swift
public init(_ range: PartialRangeFrom<Int>)
Parameters
range
The partial closed range of allowed match counts
-
Creates a new range from the supplied closed range meaning that the number of allowable matches is infinite
Declaration
Swift
public init(_ range: ClosedRange<Int>)
Parameters
range
The closed range of allowed match counts
-
A pre-specified constant for one and exactly one matches
Declaration
Swift
public static let one: Cardinality
-
A pre-specified constant for optional matches (between 0 and 1 matches)
Declaration
Swift
public static let zeroOrOne: Cardinality
-
A pre-specified constant for optional but unbound matches (between 0 and infinity matches)
Declaration
Swift
public static let zeroOrMore: Cardinality
-
A pre-specified constant for required but unbound matches (between 1 and infinity matches)
Declaration
Swift
public static let oneOrMore: Cardinality
-
The equality function
Declaration
Swift
public static func == (lhs: Cardinality, rhs: Cardinality) -> Bool