public final class Multiplicity extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Multiplicity |
SINGLE_OPTIONAL
Static instance of a multiplicity of 0..1 (single optional).
|
static Multiplicity |
SINGLE_REQUIRED
Static instance of a multiplicity of 1 (single required).
|
Constructor and Description |
---|
Multiplicity(int number)
Creates a fixed multiplicity (where there are a fixed number of
occurrences).
|
Multiplicity(int minimum,
int maximum)
Creates a range multiplicity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getMaximum()
Returns the maximum number of occurrences.
|
int |
getMinimum()
Returns the minimum number of occurrences.
|
int |
hashCode() |
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.
|
static Multiplicity |
parse(String value)
Parse an object from a string using the
toString() syntax, e.g. |
String |
toString() |
public static final Multiplicity SINGLE_REQUIRED
public static final Multiplicity SINGLE_OPTIONAL
public Multiplicity(int number) throws APIException
number
- the number of occurrences - must be greater than 0.APIException
- if the specified number is not greater than 0.public Multiplicity(int minimum, int maximum) throws APIException
minimum
- the minimum number of occurrences. Must be zero or
greater.maximum
- the maximum number of occurrences. Must be greater than
or equal to minimum or -1 indicating no maximum.APIException
- if either minimum or maximum value is invalid.public static Multiplicity parse(String value) throws APIException
toString()
syntax, e.g.
1..*value
- String of the format n or n..n|* where n is a non-negative
integerAPIException
- if the value can not be parsedpublic int getMinimum()
public int getMaximum()
public boolean hasMaximum()
public boolean isRepeating()
public boolean isSingle()
public boolean isSingleRequired()
public boolean isSingleOptional()
public boolean isFixed()
public boolean isVariable()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.