Package net.sf.saxon.s9api
Enum Class OccurrenceIndicator
- All Implemented Interfaces:
Serializable,Comparable<OccurrenceIndicator>,Constable
Represents one of the possible occurrence indicators in a SequenceType. The four standard values are
ONE (no occurrence indicator), ZERO_OR_ONE (?), ZERO_OR_MORE (*), ONE_OR_MORE (+). In addition the
value ZERO is supported: this is used only in the type empty-sequence() which matches an empty sequence
and nothing else.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionOccurrence indicator for a sequence that allows exactly one item, corresponding to the absence of an occurrence indicator in XPath SequenceType syntax.Occurrence indicator for a sequence that allows one or more items, corresponding to "+" in XPath SequenceType syntax.Occurrence indicator for a sequence type that only allows zero-length sequences, that is the typeempty-sequence().Occurrence indicator for a sequence that allows any number of items, corresponding to "*" in XPath SequenceType syntax.Occurrence indicator for a sequence that is either empty or that contains a single item, corresponding to "?" in XPath SequenceType syntax. -
Method Summary
Modifier and TypeMethodDescriptionstatic OccurrenceIndicatorgetOccurrenceIndicator(int cardinality) Get theOccurrenceIndicatorvalue corresponding to an internal cardinality propertybooleansubsumes(OccurrenceIndicator other) Ask whether one occurrence indicator subsumes another.toString()Return a string representation of the occurrence indicator: one of "*", "+", "?", "0" (exactly zero) or empty string (exactly one)static OccurrenceIndicatorReturns the enum constant of this class with the specified name.static OccurrenceIndicator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ZERO
Occurrence indicator for a sequence type that only allows zero-length sequences, that is the typeempty-sequence(). May be used with an item type. -
ZERO_OR_ONE
Occurrence indicator for a sequence that is either empty or that contains a single item, corresponding to "?" in XPath SequenceType syntax. -
ZERO_OR_MORE
Occurrence indicator for a sequence that allows any number of items, corresponding to "*" in XPath SequenceType syntax. -
ONE
Occurrence indicator for a sequence that allows exactly one item, corresponding to the absence of an occurrence indicator in XPath SequenceType syntax. -
ONE_OR_MORE
Occurrence indicator for a sequence that allows one or more items, corresponding to "+" in XPath SequenceType syntax.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getOccurrenceIndicator
Get theOccurrenceIndicatorvalue corresponding to an internal cardinality property- Parameters:
cardinality- the internal cardinality property, for exampleStaticProperty.ALLOWS_ONE_OR_MORE.- Returns:
- the corresponding
OccurrenceIndicator
-
subsumes
Ask whether one occurrence indicator subsumes another. Specifically,A.subsumes(B)is true if every sequence that satisfies the occurrence indicator B also satisfies the occurrence indicator A.- Parameters:
other- The other occurrence indicator- Returns:
- true if this occurrence indicator subsumes the other occurrence indicator
- Since:
- 9.1
-
toString
Return a string representation of the occurrence indicator: one of "*", "+", "?", "0" (exactly zero) or empty string (exactly one)- Overrides:
toStringin classEnum<OccurrenceIndicator>- Returns:
- a string representation of the occurrence indicator
- Since:
- 9.5
-