/** * Test whether two SequenceType objects represent the same type * * @param other the other SequenceType object * @return true if the other object is a SequenceType representing the same type * @since 9.5 */ public final boolean equals(Object other) { return other instanceof SequenceType && ((SequenceType) other).getOccurrenceIndicator().equals(getOccurrenceIndicator()) && ((SequenceType) other).getItemType().equals(getItemType()); }
/** * Test whether two SequenceType objects represent the same type * * @param other the other SequenceType object * @return true if the other object is a SequenceType representing the same type * @since 9.5 */ public final boolean equals(Object other) { return other instanceof SequenceType && ((SequenceType) other).getOccurrenceIndicator().equals(getOccurrenceIndicator()) && ((SequenceType) other).getItemType().equals(getItemType()); }
/** * Get a hash code with semantics corresponding to the equals() method * * @return the hash code * @since 9.5 */ public final int hashCode() { return getItemType().hashCode() ^ (getOccurrenceIndicator().hashCode() << 17); }
/** * Get a hash code with semantics corresponding to the equals() method * * @return the hash code * @since 9.5 */ public final int hashCode() { return getItemType().hashCode() ^ (getOccurrenceIndicator().hashCode() << 17); }
/** * Get the type of the result of the function * <p>This method must be implemented in all subtypes.</p> * * @param suppliedArgumentTypes the static types of the supplied arguments to the function. * This is provided so that a more precise result type can be returned in the common * case where the type of the result depends on the types of the arguments. * @return the return type of the function, as defined by its function signature */ @Override public SequenceType getResultType(SequenceType[] suppliedArgumentTypes) { net.sf.saxon.s9api.SequenceType declaredResult = function.getResultType(); return net.sf.saxon.value.SequenceType.makeSequenceType( declaredResult.getItemType().getUnderlyingItemType(), declaredResult.getOccurrenceIndicator().getCardinality()); }
/** * Get the required types for the arguments of this function. * <p>This method must be implemented in all subtypes.</p> * * @return the required types of the arguments, as defined by the function signature. Normally * this should be an array of size {@link #getMaximumNumberOfArguments()}; however for functions * that allow a variable number of arguments, the array can be smaller than this, with the last * entry in the array providing the required type for all the remaining arguments. */ /*@NotNull*/ @Override public net.sf.saxon.value.SequenceType[] getArgumentTypes() { net.sf.saxon.s9api.SequenceType[] declaredArgs = function.getArgumentTypes(); net.sf.saxon.value.SequenceType[] types = new net.sf.saxon.value.SequenceType[declaredArgs.length]; for (int i = 0; i < declaredArgs.length; i++) { types[i] = net.sf.saxon.value.SequenceType.makeSequenceType( declaredArgs[i].getItemType().getUnderlyingItemType(), declaredArgs[i].getOccurrenceIndicator().getCardinality()); } return types; }
/** * Get the type of the result of the function * <p>This method must be implemented in all subtypes.</p> * * @param suppliedArgumentTypes the static types of the supplied arguments to the function. * This is provided so that a more precise result type can be returned in the common * case where the type of the result depends on the types of the arguments. * @return the return type of the function, as defined by its function signature */ @Override public SequenceType getResultType(SequenceType[] suppliedArgumentTypes) { net.sf.saxon.s9api.SequenceType declaredResult = function.getResultType(); return net.sf.saxon.value.SequenceType.makeSequenceType( declaredResult.getItemType().getUnderlyingItemType(), declaredResult.getOccurrenceIndicator().getCardinality()); }
/** * Get the required types for the arguments of this function. * <p>This method must be implemented in all subtypes.</p> * * @return the required types of the arguments, as defined by the function signature. Normally * this should be an array of size {@link #getMaximumNumberOfArguments()}; however for functions * that allow a variable number of arguments, the array can be smaller than this, with the last * entry in the array providing the required type for all the remaining arguments. */ /*@NotNull*/ @Override public net.sf.saxon.value.SequenceType[] getArgumentTypes() { net.sf.saxon.s9api.SequenceType[] declaredArgs = function.getArgumentTypes(); net.sf.saxon.value.SequenceType[] types = new net.sf.saxon.value.SequenceType[declaredArgs.length]; for (int i = 0; i < declaredArgs.length; i++) { types[i] = net.sf.saxon.value.SequenceType.makeSequenceType( declaredArgs[i].getItemType().getUnderlyingItemType(), declaredArgs[i].getOccurrenceIndicator().getCardinality()); } return types; }