Package javax.xml.xquery
Interface XQSequenceType
-
- All Known Subinterfaces:
XQItemType
- All Known Implementing Classes:
SaxonXQItemType,SaxonXQSequenceType
public interface XQSequenceTypeTheXQSequenceTypeinterface represents a sequence type as XQuery 1.0: An XML Query language. TheXQSequenceTypeis the base interface for theXQItemTypeinterface and contains an occurence indicator.
-
-
Field Summary
Fields Modifier and Type Field Description static intOCC_EMPTYstatic intOCC_EXACTLY_ONEstatic intOCC_ONE_OR_MOREstatic intOCC_ZERO_OR_MOREstatic intOCC_ZERO_OR_ONE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Compares the specified object with this sequence type for equality.intgetItemOccurrence()Returns the occurrence indicator for the sequence type.XQItemTypegetItemType()Returns the type of the item in the sequence type.inthashCode()Returns a hash code consistent with the definition of the equals method.java.lang.StringtoString()Returns a human-readable implementation-defined string representation of the sequence type.
-
-
-
Field Detail
-
OCC_ZERO_OR_ONE
static final int OCC_ZERO_OR_ONE
- See Also:
- Constant Field Values
-
OCC_EXACTLY_ONE
static final int OCC_EXACTLY_ONE
- See Also:
- Constant Field Values
-
OCC_ZERO_OR_MORE
static final int OCC_ZERO_OR_MORE
- See Also:
- Constant Field Values
-
OCC_ONE_OR_MORE
static final int OCC_ONE_OR_MORE
- See Also:
- Constant Field Values
-
OCC_EMPTY
static final int OCC_EMPTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getItemType
XQItemType getItemType()
Returns the type of the item in the sequence type.- Returns:
XQItemTyperepresenting the item type in the sequence.nullis returned in case of an empty sequence.
-
getItemOccurrence
int getItemOccurrence()
Returns the occurrence indicator for the sequence type. One of:Occurrence indicators Description Value Zero or one OCC_ZERO_OR_ONEExactly one OCC_EXACTLY_ONEZero or more OCC_ZERO_OR_MOREOne or more OCC_ONE_OR_MOREEmpty OCC_EMPTY- Returns:
intindicating the occurrence indicator
-
toString
java.lang.String toString()
Returns a human-readable implementation-defined string representation of the sequence type.- Overrides:
toStringin classjava.lang.Object- Returns:
- a
Stringrepresentation of the sequence type
-
equals
boolean equals(java.lang.Object o)
Compares the specified object with this sequence type for equality. The result istrueonly if the argument is a sequence type object which represents the same XQuery sequence type.
In order to comply with the general contract ofequalsandhashCodeacross different implementations the following algorithm must be used. Returntrueif and only if both objects areXQsequenceTypeand:getItemOccurrence()is equal- if not
OCC_EMPTY,getItemType()is equal
- Overrides:
equalsin classjava.lang.Object- Parameters:
o- anXQItemTypeobject representing an XQuery sequence type- Returns:
trueif the input item type object represents the same XQuery sequence type,falseotherwise
-
hashCode
int hashCode()
Returns a hash code consistent with the definition of the equals method.
In order to comply with the general contract ofequalsandhashCodeacross different implementations the following algorithm must be used:int hashCode; if (getItemOccurrence() == XQSequenceType.OCC_EMPTY) { hashCode = 1; } else { hashCode = getItemOccurrence()*31 + getItemType().hashCode(); }- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code for this item type
-
-