001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 1998-2005 Julian Hyde
008// Copyright (C) 2005-2006 Pentaho and others
009// All Rights Reserved.
010*/
011package mondrian.olap;
012
013/**
014 * A <code>FunCall</code> is a function applied to a list of operands.
015 *
016 * <p>The parser creates function calls as an
017 * {@link mondrian.mdx.UnresolvedFunCall unresolved  function call}.
018 * The validator converts it to a
019 * {@link  mondrian.mdx.ResolvedFunCall resolved function call},
020 * which has a {@link FunDef function definition} and extra type information.
021 *
022 * @author jhyde
023 * @since Jan 6, 2006
024 */
025public interface FunCall extends Exp {
026    /**
027     * Returns the <code>index</code><sup>th</sup> argument to this function
028     * call.
029     *
030     * @param index Ordinal of the argument
031     * @return <code>index</code><sup>th</sup> argument to this function call
032     */
033    Exp getArg(int index);
034
035    /**
036     * Returns the arguments to this function.
037     *
038     * @return array of arguments
039     */
040    Exp[] getArgs();
041
042    /**
043     * Returns the number of arguments to this function.
044     *
045     * @return number of arguments
046     */
047    int getArgCount();
048
049    /**
050     * Returns the name of the function.
051     */
052    String getFunName();
053
054    /**
055     * Returns the syntax of the call.
056     */
057    Syntax getSyntax();
058}
059
060// End FunCall.java