Package adql.query.operand.function

## Class ADQLFunction

- java.lang.Object
- - adql.query.operand.function.ADQLFunction

- All Implemented Interfaces:
    `ADQLObject`, `ADQLOperand`
  Direct Known Subclasses:
    `GeometryFunction`, `MathFunction`, `SQLFunction`, `UserDefinedFunction`

      public abstract class ADQLFunction
      extends java.lang.Object
      implements ADQLOperand

  Represents any kind of function.
  Version:
    1.4 (06/2015)
  Author:
    Grégory Mantelet (CDS;ARI)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected class` | `ADQLFunction.ParameterIterator` | Lets iterating on all parameters of the given function.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ADQLFunction()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ADQLIterator` | `adqlIterator()` | Gets an iterator on the intern ADQL objects.
    `abstract int` | `getNbParameters()` | Gets the number of parameters this function has.
    `abstract ADQLOperand` | `getParameter​(int index)` | Gets the index-th parameter.
    `abstract ADQLOperand[]` | `getParameters()` | Gets the list of all parameters of this function.
    `TextPosition` | `getPosition()` | Gets the position of this object/token in the ADQL query.
    `java.util.Iterator<ADQLOperand>` | `paramIterator()` | Creates an iterator on the parameters of this function.
    `abstract ADQLOperand` | `setParameter​(int index, ADQLOperand replacer)` | Replaces the index-th parameter by the given one.
    `void` | `setPosition​(TextPosition position)` | Set the position of this `ADQLFunction` in the ADQL query string.
    `java.lang.String` | `toADQL()` | Gets the ADQL expression of this object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface adql.query.ADQLObject

      `getCopy, getName`

    - ### Methods inherited from interface adql.query.operand.ADQLOperand

      `isGeometry, isNumeric, isString`

- - ### Constructor Detail

    - #### ADQLFunction

          public ADQLFunction()

  - ### Method Detail

    - #### getPosition

          public final TextPosition getPosition()

      Description copied from interface: `ADQLObject`

      Gets the position of this object/token in the ADQL query.

      By default, no position should be set.

      Specified by:
        `getPosition` in interface `ADQLObject`
      Returns:
        Position of this ADQL item in the ADQL query, or NULL if not written originally in the query (for example, if added afterwards.

    - #### setPosition

          public final void setPosition​(TextPosition position)

      Set the position of this `ADQLFunction` in the ADQL query string.
      Parameters:
        `position` - New position of this `ADQLFunction`
      Since:
        1.4

    - #### getNbParameters

          public abstract int getNbParameters()

      Gets the number of parameters this function has.
      Returns:
        Number of parameters.

    - #### getParameters

          public abstract ADQLOperand[] getParameters()

      Gets the list of all parameters of this function.
      Returns:
        Its parameters list.

    - #### getParameter

          public abstract ADQLOperand getParameter​(int index)
                                            throws java.lang.ArrayIndexOutOfBoundsException

      Gets the index-th parameter.
      Parameters:
        `index` - Parameter number.
      Returns:
        The corresponding parameter.
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - If the index is incorrect (index < 0 || index >= getNbParameters()).

    - #### setParameter

          public abstract ADQLOperand setParameter​(int index,
                                                   ADQLOperand replacer)
                                            throws java.lang.ArrayIndexOutOfBoundsException,
                                                   java.lang.NullPointerException,
                                                   java.lang.Exception

      Replaces the index-th parameter by the given one.
      Parameters:
        `index` - Index of the parameter to replace.
        `replacer` - The replacer.
      Returns:
        The replaced parameter.
      Throws:
        `java.lang.ArrayIndexOutOfBoundsException` - If the index is incorrect (index < 0 || index >= getNbParameters()).
        `java.lang.NullPointerException` - If a required parameter must be replaced by a NULL object.
        `java.lang.Exception` - If another error occurs.

    - #### paramIterator

          public java.util.Iterator<ADQLOperand> paramIterator()

      Creates an iterator on the parameters of this function.
      Returns:
        Parameters iterator.

    - #### adqlIterator

          public ADQLIterator adqlIterator()

      Description copied from interface: `ADQLObject`

      Gets an iterator on the intern ADQL objects.

      Note:The returned iterator is particularly used by a `ISearchHandler` extension to browse a whole ADQL tree.

      Specified by:
        `adqlIterator` in interface `ADQLObject`
      Returns:
        An ADQL objects iterator.
      See Also:
        `ADQLIterator`, `ISearchHandler`

    - #### toADQL

          public java.lang.String toADQL()

      Description copied from interface: `ADQLObject`
      Gets the ADQL expression of this object.
      Specified by:
        `toADQL` in interface `ADQLObject`
      Returns:
        The corresponding ADQL expression.