Package net.sf.saxon.s9api
Enum OccurrenceIndicator
- java.lang.Object
- 
- java.lang.Enum<OccurrenceIndicator>
- 
- net.sf.saxon.s9api.OccurrenceIndicator
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Comparable<OccurrenceIndicator>
 
 public enum OccurrenceIndicator extends java.lang.Enum<OccurrenceIndicator> 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.
- 
- 
Enum Constant SummaryEnum Constants Enum Constant Description ONEONE_OR_MOREZEROZERO_OR_MOREZERO_OR_ONE
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsMany()Ask whether this occurrence indicator permits a sequence containing more than one item.booleanallowsZero()Ask whether this occurrence indicator permits an empty sequence.protected intgetCardinality()protected static OccurrenceIndicatorgetOccurrenceIndicator(int cardinality)booleansubsumes(OccurrenceIndicator other)Ask whether one occurrence indicator subsumes another.java.lang.StringtoString()Return a string representation of the occurrence indicator: one of "*", "+", "?", "0" (exactly zero) or empty string (exactly one)static OccurrenceIndicatorvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static OccurrenceIndicator[]values()Returns an array containing the constants of this enum type, in the order they are declared.
 
- 
- 
- 
Enum Constant Detail- 
ZEROpublic static final OccurrenceIndicator ZERO 
 - 
ZERO_OR_ONEpublic static final OccurrenceIndicator ZERO_OR_ONE 
 - 
ZERO_OR_MOREpublic static final OccurrenceIndicator ZERO_OR_MORE 
 - 
ONEpublic static final OccurrenceIndicator ONE 
 - 
ONE_OR_MOREpublic static final OccurrenceIndicator ONE_OR_MORE 
 
- 
 - 
Method Detail- 
valuespublic static OccurrenceIndicator[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OccurrenceIndicator c : OccurrenceIndicator.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static OccurrenceIndicator valueOf(java.lang.String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
- java.lang.IllegalArgumentException- if this enum type has no constant with the specified name
- java.lang.NullPointerException- if the argument is null
 
 - 
getCardinalityprotected int getCardinality() 
 - 
getOccurrenceIndicatorprotected static OccurrenceIndicator getOccurrenceIndicator(int cardinality) 
 - 
allowsZeropublic boolean allowsZero() Ask whether this occurrence indicator permits an empty sequence.- Returns:
- true if the occurrence indicator is one of ZERO,ZERO_OR_ONE, orZERO_OR_MORE
- Since:
- 9.2
 
 - 
allowsManypublic boolean allowsMany() Ask whether this occurrence indicator permits a sequence containing more than one item.- Returns:
- true if the occurrence indicator is one of ZERO_OR_MOREorONE_OR_MORE
- Since:
- 9.2
 
 - 
subsumespublic boolean subsumes(OccurrenceIndicator other) 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
 
 - 
toStringpublic java.lang.String toString() Return a string representation of the occurrence indicator: one of "*", "+", "?", "0" (exactly zero) or empty string (exactly one)- Overrides:
- toStringin class- java.lang.Enum<OccurrenceIndicator>
- Returns:
- a string representation of the occurrence indicator
- Since:
- 9.5
 
 
- 
 
-