Package javax.xml.xquery
Interface XQSequenceType
- All Known Subinterfaces:
XQItemType
- All Known Implementing Classes:
SaxonXQItemType
,SaxonXQSequenceType
public interface XQSequenceType
The
XQSequenceType
interface represents a sequence type as
XQuery 1.0: An XML Query language.
The XQSequenceType
is the base interface for the
XQItemType
interface and contains an occurence indicator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specified object with this sequence type for equality.int
Returns the occurrence indicator for the sequence type.Returns the type of the item in the sequence type.int
hashCode()
Returns a hash code consistent with the definition of the equals method.toString()
Returns a human-readable implementation-defined string representation of the sequence type.
-
Field Details
-
OCC_ZERO_OR_ONE
static final int OCC_ZERO_OR_ONE- See Also:
-
OCC_EXACTLY_ONE
static final int OCC_EXACTLY_ONE- See Also:
-
OCC_ZERO_OR_MORE
static final int OCC_ZERO_OR_MORE- See Also:
-
OCC_ONE_OR_MORE
static final int OCC_ONE_OR_MORE- See Also:
-
OCC_EMPTY
static final int OCC_EMPTY- See Also:
-
-
Method Details
-
getItemType
XQItemType getItemType()Returns the type of the item in the sequence type.- Returns:
XQItemType
representing the item type in the sequence.null
is 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_ONE
Exactly one OCC_EXACTLY_ONE
Zero or more OCC_ZERO_OR_MORE
One or more OCC_ONE_OR_MORE
Empty OCC_EMPTY
- Returns:
int
indicating the occurrence indicator
-
toString
String toString()Returns a human-readable implementation-defined string representation of the sequence type. -
equals
Compares the specified object with this sequence type for equality. The result istrue
only if the argument is a sequence type object which represents the same XQuery sequence type.In order to comply with the general contract of
equals
andhashCode
across different implementations the following algorithm must be used. Returntrue
if and only if both objects areXQsequenceType
and:getItemOccurrence()
is equal- if not
OCC_EMPTY
,getItemType()
is equal
-
hashCode
int hashCode()Returns a hash code consistent with the definition of the equals method.In order to comply with the general contract of
equals
andhashCode
across different implementations the following algorithm must be used:int hashCode; if (getItemOccurrence() == XQSequenceType.OCC_EMPTY) { hashCode = 1; } else { hashCode = getItemOccurrence()*31 + getItemType().hashCode(); }
-