net.sf.saxon.value
public final class Cardinality extends Object
Method Summary | |
---|---|
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 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 String | toString(int cardinality)
Display the cardinality as a string |
static int | union(int c1, int c2)
Form the union of two cardinalities. |
Parameters: cardinality the cardinality of a sequence
Returns: true if the cardinality allows the sequence to contain more than one item
Parameters: cardinality the cardinality of a sequence
Returns: true if the cardinality allows the sequence to be empty
Parameters: expression an expression
Returns: true if multiple occurrences are not only allowed, but likely. Return false if multiple occurrences are unlikely, even though they might be allowed. This is typically the case for the atomized sequence that is obtained by atomizing a singleton node.
Parameters: cardinality the cardinality value
Returns: the occurrence indicator, for example "*", "+", "?", "".
Parameters: c1 the first cardinality c2 the second cardinality
Returns: the product of the cardinalities, that is, the cardinality of the sequence "for $x in S1 return S2", where c1 is the cardinality of S1 and c2 is the cardinality of S2
Parameters: c1 a cardinality c2 another cardinality
Returns: true if if every option permitted by c2 is also permitted by c1.
Parameters: c1 the first cardinality c2 the second cardinality
Returns: the cardinality of a sequence formed by concatenating the sequences whose cardinalities are c1 and c2
Parameters: cardinality the cardinality value to be displayed
Returns: the representation as a string, for example "zero or one", "zero or more"
Parameters: c1 a cardinality c2 another cardinality
Returns: the cardinality that allows both c1 and c2