Package net.sf.saxon.value
Class Cardinality
- java.lang.Object
-
- net.sf.saxon.value.Cardinality
-
public final class Cardinality extends java.lang.ObjectThis class contains static methods to manipulate the cardinality property of a type. Cardinality of expressions is denoted by one of the values ONE_OR_MORE, ZERO_OR_MORE, ZERO_OR_ONE, EXACTLY_ONE, or EMPTY. These are combinations of the three bit-significant values ALLOWS_ZERO, ALLOWS_ONE, and ALLOWS_MANY.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intadd(int c1, int c2)Add two cardinalitiesstatic booleanallowsMany(int cardinality)Determine whether multiple occurrences are allowedstatic booleanallowsZero(int cardinality)Determine whether empty sequence is allowedstatic java.lang.StringgetOccurrenceIndicator(int cardinality)Get the occurence indicator representing the cardinalitystatic intmultiply(int c1, int c2)Multiply two cardinalitiesstatic booleansubsumes(int c1, int c2)Test if one cardinality subsumes another.static intsum(int c1, int c2)Form the sum of two cardinalitiesstatic java.lang.StringtoString(int cardinality)Display the cardinalitystatic intunion(int c1, int c2)Form the union of two cardinalities.
-
-
-
Method Detail
-
allowsMany
public static final boolean allowsMany(int cardinality)
Determine whether multiple occurrences are allowed
-
allowsZero
public static final boolean allowsZero(int cardinality)
Determine whether empty sequence is allowed
-
union
public static final int union(int c1, int c2)Form the union of two cardinalities. The cardinality of the expression "if (c) then e1 else e2" is the union of the cardinalities of e1 and e2.- Parameters:
c1- a cardinalityc2- another cardinality- Returns:
- the cardinality that allows both c1 and c2
-
sum
public static final int sum(int c1, int c2)Form the sum of two cardinalities
-
subsumes
public static final boolean subsumes(int c1, int c2)Test if one cardinality subsumes another. Cardinality c1 subsumes c2 if every option permitted by c2 is also permitted by c1.- Parameters:
c1- a cardinalityc2- another cardinality- Returns:
- true if if every option permitted by c2 is also permitted by c1.
-
add
public static final int add(int c1, int c2)Add two cardinalities
-
multiply
public static final int multiply(int c1, int c2)Multiply two cardinalities
-
toString
public static java.lang.String toString(int cardinality)
Display the cardinality
-
getOccurrenceIndicator
public static java.lang.String getOccurrenceIndicator(int cardinality)
Get the occurence indicator representing the cardinality
-
-