public static interface MNode.Multiplicity
Multiplicity describes the number of times that the node may occur and is
defined in terms of a minimum and maximum value. The minimum value may be
zero or positive and the maximum must be greater than or equal to the
minimum and greater than 0. A special maximum value of -1 (or
UNLIMITED
) is used to indicate that there is no
limit on the maximum number of occurrences. Note that -1 is represented
by a '*' in standard UML notation.
Typical multiplicity values are:
0..1 zero or one instance (single optional)
1 exactly one instance (single required)
0..* zero or more instances (repeated optional)
1..* one or more instances (repeated required)
Instances of Multiplicity cannot be explicitly created but are returned
from metadata definitions. The multiplicity of a node is typically
defined when it is added to a parent group (e.g.
MGroup.Builder.add(MNode, int, int)
.
Modifier and Type | Field and Description |
---|---|
static MNode.Multiplicity |
NONE
Special singleton value used for nodes that have no parent.
|
static MNode.Multiplicity |
SINGLE
Special singleton value that may be used for nodes with multiplicity
1..1.
|
static MNode.Multiplicity |
UNBOUNDED
Special singleton value that may be used for nodes with multiplicity
0..n.
|
static int |
UNLIMITED
Special maximum value that indicates no maximum.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasMaximum()
Indicates whether there is a maximum number of occurrences (i.e.
|
boolean |
isFixed()
Indicates whether this is a fixed multiplicity (i.e.
|
boolean |
isRepeating()
Indicates whether this is a 'repeating' multiplicity meaning it
defines more than one possible occurrence.
|
boolean |
isSingle()
Indicates whether this is 'single' multiplicity meaning that only 1
(or 0 if optional) occurrence can exist.
|
boolean |
isSingleOptional()
Indicates whether this is a 'single optional' multiplicity (i.e.
|
boolean |
isSingleRequired()
Indicates whether this is a 'single required' multiplicity (i.e.
|
boolean |
isVariable()
Indicates whether this is variable multiplicity (i.e.
|
int |
maximum()
Returns the maximum number of occurrences.
|
int |
minimum()
Returns the minimum number of occurrences.
|
static final MNode.Multiplicity NONE
static final MNode.Multiplicity UNBOUNDED
static final MNode.Multiplicity SINGLE
static final int UNLIMITED
int minimum()
int maximum()
boolean hasMaximum()
boolean isRepeating()
boolean isSingle()
boolean isSingleRequired()
boolean isSingleOptional()
boolean isFixed()
boolean isVariable()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.