public final class Cardinality
extends java.lang.Object
Modifier and Type | Method and 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 int |
fromOccurrenceIndicator(char cardinality)
Get the cardinality code from an occurrence indicator
|
static java.lang.String |
generateJavaScriptChecker(int card)
Generate Javascript code to check whether a number satisfies the cardinality property.
|
static java.lang.String |
getOccurrenceIndicator(int cardinality)
Get the occurrence 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 valuepublic static int fromOccurrenceIndicator(char cardinality)
cardinality
- the cardinality valuepublic static java.lang.String generateJavaScriptChecker(int card)
card
- the cardinality valueCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.