Interface XQSequenceType

    • Method Detail

      • 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

        java.lang.String toString()
        Returns a human-readable implementation-defined string representation of the sequence type.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of the sequence type
      • equals

        boolean equals​(java.lang.Object o)
        Compares the specified object with this sequence type for equality. The result is true 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 and hashCode across different implementations the following algorithm must be used. Return true if and only if both objects are XQsequenceType and:

        • getItemOccurrence() is equal
        • if not OCC_EMPTY, getItemType() is equal
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - an XQItemType object representing an XQuery sequence type
        Returns:
        true if the input item type object represents the same XQuery sequence type, false otherwise
      • 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 and hashCode across different implementations the following algorithm must be used:

          int hashCode;
          if (getItemOccurrence() == XQSequenceType.OCC_EMPTY)
          {
            hashCode = 1;
          }
          else
          {
            hashCode = getItemOccurrence()*31 + getItemType().hashCode();
          }
         
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code for this item type