/** * Get the qualified of the function being called * @return the qualified name */ public final StructuredQName getFunctionName() { StructuredQName n = super.getFunctionName(); if (n == null) { return function.getFunctionName(); } else { return n; } }
/** * Get the name of the function for display in messages * * @return the name of the function as a lexical QName */ public final String getDisplayName() { StructuredQName fName = getFunctionName(); return fName == null ? "(anonymous)" : fName.getDisplayName(); }
/** * Get the name of the function for display in messages * @return the name of the function as a lexical QName */ public final String getDisplayName() { return getFunctionName().getDisplayName(); }
/** * Get the qualified of the function being called * @return the qualified name */ public final StructuredQName getFunctionName() { StructuredQName n = super.getFunctionName(); if (n == null) { return function.getFunctionName(); } else { return n; } }
/** * Get the qualified of the function being called * @return the qualified name */ public final StructuredQName getFunctionName() { StructuredQName n = super.getFunctionName(); if (n == null) { return function.getFunctionName(); } else { return n; } }
/** * Get the name of the function for display in messages * @return the name of the function as a lexical QName */ public final String getDisplayName() { return getFunctionName().getDisplayName(); }
/** * Get the name of the function for display in messages * * @return the name of the function as a lexical QName */ public final String getDisplayName() { StructuredQName fName = getFunctionName(); return fName == null ? "(anonymous)" : fName.getDisplayName(); }
/** * Get the name of the function for display in messages * @return the name of the function as a lexical QName */ public final String getDisplayName() { return getFunctionName().getDisplayName(); }
private boolean functionEqualsBuiltin (FunctionCall funcall, String builtinFunction) { return funcall.getFunctionName().getDisplayName().equals (builtinFunction); }
/** * Get hashCode in support of equals() method */ public int hashCode() { int h = getFunctionName().hashCode(); for (int i=0; i<getNumberOfArguments(); i++) { h ^= argument[i].hashCode(); } return h; }
/** * Get hashCode in support of equals() method */ public int hashCode() { int h = getFunctionName().hashCode(); for (int i=0; i<getNumberOfArguments(); i++) { h ^= argument[i].hashCode(); } return h; }
/** * Get hashCode in support of equals() method */ public int hashCode() { int h = getFunctionName().hashCode(); for (int i=0; i<getNumberOfArguments(); i++) { h ^= argument[i].hashCode(); } return h; }
/** * Produce a short string identifying the expression for use in error messages * * @return a short string, sufficient to identify the expression */ @Override public String toShortString() { StructuredQName fName = getFunctionName(); return (fName == null ? "$anonFn" : fName.getDisplayName()) + "(" + (getArity() == 0 ? "" : "...") + ")"; }
/** * Produce a short string identifying the expression for use in error messages * * @return a short string, sufficient to identify the expression */ @Override public String toShortString() { StructuredQName fName = getFunctionName(); return (fName == null ? "$anonFn" : fName.getDisplayName()) + "(" + (getArity() == 0 ? "" : "...") + ")"; }
/** * Determine whether an expression contains a call on the function with a given name * * @param exp The expression being tested * @param qName The name of the function * @param sameFocusOnly If true, only expressions with the same (top-level) focus are searched * @return true if the expression contains a call on the function */ public static boolean callsFunction(Expression exp, final StructuredQName qName, boolean sameFocusOnly) { return contains(exp, sameFocusOnly, e -> e instanceof FunctionCall && qName.equals(((FunctionCall) e).getFunctionName()) ); }
/** * Determine whether an expression contains a call on the function with a given name * * @param exp The expression being tested * @param qName The name of the function * @param sameFocusOnly If true, only expressions with the same (top-level) focus are searched * @return true if the expression contains a call on the function */ public static boolean callsFunction(Expression exp, final StructuredQName qName, boolean sameFocusOnly) { return contains(exp, sameFocusOnly, e -> e instanceof FunctionCall && qName.equals(((FunctionCall) e).getFunctionName()) ); }
/** * Get hashCode in support of equals() method */ public int computeHashCode() { if (getFunctionName() == null) { return super.computeHashCode(); } int h = getFunctionName().hashCode(); for (int i = 0; i < getArity(); i++) { h ^= getArg(i).hashCode(); } return h; }
/** * Get hashCode in support of equals() method */ public int computeHashCode() { if (getFunctionName() == null) { return super.computeHashCode(); } int h = getFunctionName().hashCode(); for (int i = 0; i < getArity(); i++) { h ^= getArg(i).hashCode(); } return h; }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter out) throws XPathException { out.startElement("functionCall", this); if (getFunctionName() == null) { throw new AssertionError("Exporting call to anonymous function"); } else { out.emitAttribute("name", getFunctionName().getDisplayName()); } for (Operand o : operands()) { o.getChildExpression().export(out); } out.endElement(); }
/** * Diagnostic print of expression structure. The abstract expression tree * is written to the supplied output destination. */ public void export(ExpressionPresenter out) throws XPathException { out.startElement("functionCall", this); if (getFunctionName() == null) { throw new AssertionError("Exporting call to anonymous function"); } else { out.emitAttribute("name", getFunctionName().getDisplayName()); } for (Operand o : operands()) { o.getChildExpression().export(out); } out.endElement(); }