From: <wol...@us...> - 2012-03-28 12:58:36
|
Revision: 16205 http://exist.svn.sourceforge.net/exist/?rev=16205&view=rev Author: wolfgang_m Date: 2012-03-28 12:58:24 +0000 (Wed, 28 Mar 2012) Log Message: ----------- [ignore] Comments added. Modified Paths: -------------- trunk/eXist/src/org/exist/xquery/PartialFunctionReference.java trunk/eXist/src/org/exist/xquery/value/FunctionReference.java Modified: trunk/eXist/src/org/exist/xquery/PartialFunctionReference.java =================================================================== --- trunk/eXist/src/org/exist/xquery/PartialFunctionReference.java 2012-03-28 09:14:48 UTC (rev 16204) +++ trunk/eXist/src/org/exist/xquery/PartialFunctionReference.java 2012-03-28 12:58:24 UTC (rev 16205) @@ -1,3 +1,24 @@ +/* + * eXist Open Source Native XML Database + * Copyright (C) 2012 The eXist Project + * http://exist-db.org + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * $Id$ + */ package org.exist.xquery; import java.util.ArrayList; @@ -8,6 +29,14 @@ import org.exist.xquery.value.Item; import org.exist.xquery.value.Sequence; +/** + * A function item which references a partially applied function, for which a number + * of fixed arguments were already specified but some arguments are still to be provided + * at call time. + * + * @author wolf + * + */ public class PartialFunctionReference extends FunctionReference { Sequence[] argValues; @@ -18,6 +47,10 @@ this.argValues = arguments; } + /** + * Calls {@link FunctionCall#eval(Sequence)} after making sure all parameters (fixed and dynamic) are + * merged into one argument list. + */ @Override public Sequence eval(Sequence contextSequence) throws XPathException { Sequence[] arguments = new Sequence[argValues.length]; Modified: trunk/eXist/src/org/exist/xquery/value/FunctionReference.java =================================================================== --- trunk/eXist/src/org/exist/xquery/value/FunctionReference.java 2012-03-28 09:14:48 UTC (rev 16204) +++ trunk/eXist/src/org/exist/xquery/value/FunctionReference.java 2012-03-28 12:58:24 UTC (rev 16205) @@ -1,6 +1,6 @@ /* * eXist Open Source Native XML Database - * Copyright (C) 2001-04 The eXist Project + * Copyright (C) 2001-12 The eXist Project * http://exist-db.org * * This program is free software; you can redistribute it and/or @@ -32,8 +32,7 @@ import org.exist.xquery.XQueryContext; /** - * Represents a reference to a function created by util:function that can be - * used with util:call. + * Represents a function item, i.e. a reference to a function that can be called dynamically. * * @author wolf */ @@ -54,14 +53,36 @@ return functionCall.getSignature(); } + /** + * Calls {@link FunctionCall#analyze(AnalyzeContextInfo)}. + * + * @param contextInfo + * @throws XPathException + */ public void analyze(AnalyzeContextInfo contextInfo) throws XPathException { functionCall.analyze(contextInfo); } + /** + * Calls {@link FunctionCall#eval(Sequence)}. + * + * @param contextSequence + * @return + * @throws XPathException + */ public Sequence eval(Sequence contextSequence) throws XPathException { return functionCall.eval(contextSequence); } + /** + * Calls {@link FunctionCall#evalFunction(Sequence, Item, Sequence[])}. + * + * @param contextSequence + * @param contextItem + * @param seq + * @return + * @throws XPathException + */ public Sequence evalFunction(Sequence contextSequence, Item contextItem, Sequence[] seq) throws XPathException { return functionCall.evalFunction(contextSequence, contextItem, seq); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |