Diffusion Apple API  5.9.24
Unified Client Library for iOS, OS X and tvOS
 All Classes Functions Variables Properties Pages
Class Methods | Properties | Instance Methods | List of all members
PTDiffusionMultiplicity Class Reference

Introduction

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.

See Also
PTDiffusionRecordMetadata
PTDiffusionFieldMetadata
Since
5.6
Inheritance diagram for PTDiffusionMultiplicity:

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:
 

Method Documentation

+ (instancetype) defaultMultiplicity

Returns the multiplicity for single required (1).

Since
5.6
- (instancetype) initWithMinimumCount: (NSUInteger)  minimumCount
maximumCount: (nullable NSNumber *)  maximumCount 

Returns a multiplicity object initialized with the given minimum count and maximum count values.

Parameters
minimumCountThe minimum number of instances expected.
maximumCountThe 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).
Exceptions
NSInvalidArgumentExceptionIf the maximum count value is out of acceptable range.
Since
5.6
- (BOOL) isEqualToMultiplicity: (PTDiffusionMultiplicity *)  multiplicity

Compares the receiver to the given multiplicity.

Parameters
multiplicityThe multiplicity object with which to compare the receiver.
Returns
YES if the given multiplicity is equal to the receiver, otherwise NO.
Since
5.6
+ (instancetype) multiplicityForNone

Returns a multiplicity used for metadata nodes that have no parent (0..0).

Since
5.7
+ (instancetype) multiplicityForSingleOptional

Returns a multiplicity specifying zero or one instance (0..1).

Since
5.6
+ (instancetype) multiplicityForSingleRequired

Returns a multiplicity specifying exactly once instance (1).

Since
5.6
+ (instancetype) multiplicityForUnbounded

Returns a boundless multiplicity (0..*).

Since
5.7
+ (instancetype) multiplicityWithFixedCount: (NSUInteger)  fixedCount

Returns a multiplicity specifying an exact number of instances (n).

Parameters
fixedCountThe maximum number of instances expected which must be above zero.
Since
5.6
+ (instancetype) multiplicityWithMaximumCount: (NSUInteger)  maximumCount

Returns a multiplicity specifying a maximum number of instances (0..n).

Parameters
maximumCountThe maximum number of instances expected which must be above zero.
Exceptions
NSInvalidArgumentExceptionIf the maximum count is zero.
Since
5.6
+ (instancetype) multiplicityWithMinimumCount: (NSUInteger)  minimumCount

Returns a multiplicity specifying a minimum number of instances (n..*).

Parameters
minimumCountThe minimum number of instances expected.
Since
5.6
+ (BOOL) parseMultiplicity: (out PTDiffusionMultiplicity *_Nullable __strong *_Nonnull)  multiplicity
fromString: (NSString *)  string
error: (out NSError **)  error 

Returns a multiplicity as described by the given string.

Parameters
multiplicityIf the string could be parsed then this will contain the parsed multiplicity on return.
stringThe 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.
errorIn the case of failed parsing and if set to non-nil then this will contain the reason for failure on return.
Exceptions
NSInvalidArgumentExceptionIf either multiplicity or string are nil.
Since
5.7

Property Documentation

- (NSNumber*) maximumCount
readnonatomicassign

The maximum number of instances expected or nil if unlimited (*).

Since
5.6
- (NSUInteger) minimumCount
readnonatomicassign

The minimum number of instances expected.

Since
5.6
- (BOOL) unbounded
readnonatomicassign

YES if the maximum count value specifies an unlimited number of instances (*).

Since
5.6
- (BOOL) variable
readnonatomicassign

YES if the minimum count and maximum count values differ.

Since
5.6