public class AreaFunction extends GeometryFunction
It represents the AREA function of ADQL.
This function computes the area, in square degrees, of a given geometry.
Example:
AREA(CIRCLE('ICRS GEOCENTER', 25.4, -20.0, 1)).
Inappropriate geometries for this construct (e.g. POINT) SHOULD either return zero or throw an error message. This choice must be done in an extended class of AreaFunction
.
GeometryFunction.GeometryValue<F extends GeometryFunction>
ADQLFunction.ParameterIterator
coordSys
Constructor and Description |
---|
AreaFunction(AreaFunction toCopy)
Builds an AREA function by copying the given one.
|
AreaFunction(GeometryFunction.GeometryValue<GeometryFunction> param)
Builds an AREA function with its parameter.
|
Modifier and Type | Method and Description |
---|---|
ADQLObject |
getCopy()
Gets a (deep) copy of this ADQL object.
|
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
int |
getNbParameters()
Gets the number of parameters this function has.
|
GeometryFunction.GeometryValue<GeometryFunction> |
getParameter()
Gets the parameter of the AREA function (so, a region whose the area must be computed).
|
ADQLOperand |
getParameter(int index)
Gets the index-th parameter.
|
ADQLOperand[] |
getParameters()
Gets the list of all parameters of this function.
|
boolean |
isGeometry()
Tell whether this operand is a geometrical region or not.
|
boolean |
isNumeric()
Tell whether this operand is numeric or not.
|
boolean |
isString()
Tell whether this operand is a string or not.
|
void |
setParameter(GeometryFunction.GeometryValue<GeometryFunction> parameter)
Sets the parameter of the AREA function (so, a region whose the area must be computed).
|
ADQLOperand |
setParameter(int index,
ADQLOperand replacer)
Replaces the index-th parameter by the given one.
|
getCoordinateSystem, setCoordinateSystem
adqlIterator, getPosition, paramIterator, setPosition, toADQL
public AreaFunction(GeometryFunction.GeometryValue<GeometryFunction> param) throws java.lang.NullPointerException
param
- Parameter of AREA.java.lang.NullPointerException
- If the given operand is null or if it's not a GeometryFunction
.public AreaFunction(AreaFunction toCopy) throws java.lang.Exception
toCopy
- The AREA function to copy.java.lang.Exception
- If there is an error during the copy.public final GeometryFunction.GeometryValue<GeometryFunction> getParameter()
public final void setParameter(GeometryFunction.GeometryValue<GeometryFunction> parameter)
parameter
- A region.public ADQLObject getCopy() throws java.lang.Exception
ADQLObject
java.lang.Exception
- If there is any error during the copy.public java.lang.String getName()
ADQLObject
public boolean isNumeric()
ADQLOperand
public boolean isString()
ADQLOperand
public boolean isGeometry()
ADQLOperand
public ADQLOperand[] getParameters()
ADQLFunction
getParameters
in class ADQLFunction
public int getNbParameters()
ADQLFunction
getNbParameters
in class ADQLFunction
public ADQLOperand getParameter(int index) throws java.lang.ArrayIndexOutOfBoundsException
ADQLFunction
getParameter
in class ADQLFunction
index
- Parameter number.java.lang.ArrayIndexOutOfBoundsException
- If the index is incorrect (index < 0 || index >= getNbParameters()).public ADQLOperand setParameter(int index, ADQLOperand replacer) throws java.lang.ArrayIndexOutOfBoundsException, java.lang.NullPointerException, java.lang.Exception
ADQLFunction
setParameter
in class ADQLFunction
index
- Index of the parameter to replace.replacer
- The replacer.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.