Diffusion Apple API
5.9.24
Unified Client Library for iOS, OS X and tvOS
|
Multiplicity describes the number of times that a metadata node may occur within its parent.
Multiplicity is defined in terms of minimum count and maximum count values.
The maximum count is boxed in a number object which enables it to be optional. Specifying nil
for the maximum count indicates that there should be no limit on the maximum number of occurrences.
Multiplicity objects are described using standard UML notation.
Class Methods | |
(instancetype) | + multiplicityForNone |
(instancetype) | + multiplicityForUnbounded |
(instancetype) | + multiplicityForSingleRequired |
(instancetype) | + multiplicityForSingleOptional |
(instancetype) | + multiplicityWithFixedCount: |
(instancetype) | + multiplicityWithMinimumCount: |
(instancetype) | + multiplicityWithMaximumCount: |
(BOOL) | + parseMultiplicity:fromString:error: |
(instancetype) | + defaultMultiplicity |
Properties | |
NSUInteger | minimumCount |
NSNumber * | maximumCount |
BOOL | unbounded |
BOOL | variable |
Instance Methods | |
(instancetype) | - initWithMinimumCount:maximumCount: |
(BOOL) | - isEqualToMultiplicity: |
+ (instancetype) defaultMultiplicity |
Returns the multiplicity for single required (1
).
- (instancetype) initWithMinimumCount: | (NSUInteger) | minimumCount | |
maximumCount: | (nullable NSNumber *) | maximumCount | |
Returns a multiplicity object initialized with the given minimum count and maximum count values.
minimumCount | The minimum number of instances expected. |
maximumCount | The maximum number of instances expected. Specify nil for unlimited (* ). If specified then must not be less than the minimum count or 1 (whichever is bigger). |
NSInvalidArgumentException | If the maximum count value is out of acceptable range. |
- (BOOL) isEqualToMultiplicity: | (PTDiffusionMultiplicity *) | multiplicity |
Compares the receiver to the given multiplicity.
multiplicity | The multiplicity object with which to compare the receiver. |
YES
if the given multiplicity is equal to the receiver, otherwise NO
.+ (instancetype) multiplicityForNone |
Returns a multiplicity used for metadata nodes that have no parent (0..0
).
+ (instancetype) multiplicityForSingleOptional |
Returns a multiplicity specifying zero or one instance (0..1
).
+ (instancetype) multiplicityForSingleRequired |
Returns a multiplicity specifying exactly once instance (1
).
+ (instancetype) multiplicityForUnbounded |
Returns a boundless multiplicity (0..*
).
+ (instancetype) multiplicityWithFixedCount: | (NSUInteger) | fixedCount |
Returns a multiplicity specifying an exact number of instances (n
).
fixedCount | The maximum number of instances expected which must be above zero. |
+ (instancetype) multiplicityWithMaximumCount: | (NSUInteger) | maximumCount |
Returns a multiplicity specifying a maximum number of instances (0..n
).
maximumCount | The maximum number of instances expected which must be above zero. |
NSInvalidArgumentException | If the maximum count is zero. |
+ (instancetype) multiplicityWithMinimumCount: | (NSUInteger) | minimumCount |
Returns a multiplicity specifying a minimum number of instances (n..*
).
minimumCount | The minimum number of instances expected. |
+ (BOOL) parseMultiplicity: | (out PTDiffusionMultiplicity *_Nullable __strong *_Nonnull) | multiplicity | |
fromString: | (NSString *) | string | |
error: | (out NSError **) | error | |
Returns a multiplicity as described by the given string.
multiplicity | If the string could be parsed then this will contain the parsed multiplicity on return. |
string | The string to be parsed of the form n or n..m|* where n and m are non-negative integers and m is equal to or larger than n . |
error | In the case of failed parsing and if set to non-nil then this will contain the reason for failure on return. |
NSInvalidArgumentException | If either multiplicity or string are nil . |
|
readnonatomicassign |
The maximum number of instances expected or nil
if unlimited (*
).
|
readnonatomicassign |
The minimum number of instances expected.
|
readnonatomicassign |
YES
if the maximum count value specifies an unlimited number of instances (*
).
|
readnonatomicassign |
YES
if the minimum count and maximum count values differ.