public final class Cardinality
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
static boolean |
allowsMany(int cardinality) |
Determine whether multiple occurrences are allowed
|
static boolean |
allowsZero(int cardinality) |
Determine whether empty sequence is allowed
|
static boolean |
expectsMany(Expression expression) |
Determine whether multiple occurrences are not only allowed, but likely.
|
static java.lang.String |
getOccurrenceIndicator(int cardinality) |
Get the occurence indicator representing the cardinality
|
static int |
multiply(int c1,
int c2) |
Multiply two cardinalities
|
static boolean |
subsumes(int c1,
int c2) |
Test if one cardinality subsumes another.
|
static int |
sum(int c1,
int c2) |
Add two cardinalities
|
static java.lang.String |
toString(int cardinality) |
Display the cardinality as a string
|
static int |
union(int c1,
int c2) |
Form the union of two cardinalities.
|
public static boolean allowsMany(int cardinality)
cardinality
- the cardinality of a sequencepublic static boolean expectsMany(Expression expression)
expression
- an expressionpublic static boolean allowsZero(int cardinality)
cardinality
- the cardinality of a sequencepublic static int union(int c1, int c2)
c1
- a cardinalityc2
- another cardinalitypublic static int sum(int c1, int c2)
c1
- the first cardinalityc2
- the second cardinalitypublic static boolean subsumes(int c1, int c2)
c1
- a cardinalityc2
- another cardinalitypublic static int multiply(int c1, int c2)
c1
- the first cardinalityc2
- the second cardinalitypublic static java.lang.String toString(int cardinality)
cardinality
- the cardinality value to be displayedpublic static java.lang.String getOccurrenceIndicator(int cardinality)
cardinality
- the cardinality value