# Class AdqlFeature

java.lang.Object
uk.ac.starlink.vo.AdqlFeature

Direct Known Subclasses:
  `AdqlFeature.Function`

public class AdqlFeature extends Object
Describes a documented language feature that can be used in some variant of the ADQL language.

A number of static methods are provided that return lists of features provided by a particular ADQL version either absolutely or in the context of a list of language feature declarations. This class contains knowledge about what standard mandatory and optional features are declared by known versions of the ADQL standard.

Note that ADQL 2.0 does not define a proper type system, so in the case of ADQL 2.0 the types declared here are not strictly based in the standard, but a casual reading will give the intent of what was written in the ADQL 2.0 standard.

Since:
  23 Feb 2024
Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`AdqlFeature.Arg`
Represents a declared argument of a function.
`static class`
`AdqlFeature.Function`
AdqlFeature subclass which represents a function.
`static enum`
`AdqlFeature.Type`
Datatype of a function argument or return value.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Predicate<Ivoid>`
`ADQL21MISC_FILTER`
Includes feature types for Ivoids representing optional features.
`static final Predicate<Ivoid>`
`ADQLGEO_FILTER`
Includes feature types for Ivoids representing Geometry functions.
`static final Predicate<Ivoid>`
`NONSTD_FILTER`
Includes feature types for Ivoids representing non-standard features.
`static final Predicate<Ivoid>`
`UDF_FILTER`
Includes feature types for Ivoids representing UDFs.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`AdqlFeature(String name, String description)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDescription()`
Returns a plain text description of this feature.
`static AdqlFeature.Function[]`
`getGeomFunctions(AdqlVersion version, TapCapability tcap)`
Returns an array of the standard ADQL 2.0 or 2.1 geometry functions declared by a given TapCapability object.
`static AdqlFeature.Function[]`
`getMathsFunctions()`
Returns an array of the maths functions defined by ADQL.
`String`
`getName()`
Returns the name of this feature.
`static AdqlFeature[]`
`getOptionalFeatures(TapCapability tcap)`
Returns an array of the ADQL 2.1 optional features (excluding functions) declared by a given TapCapability object.
`static AdqlFeature.Function[]`
`getOptionalFunctions(TapCapability tcap)`
Returns an array of the ADQL 2.1 optional functions (but not other optional features) declared by a given TapCapability object.
`static AdqlFeature.Function[]`
`getTrigFunctions()`
Returns an array of the trigonometric functions defined by ADQL.

### Methods inherited from class Object

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

## Field Details

### UDF_FILTER

public static final Predicate<Ivoid> UDF_FILTER
Includes feature types for Ivoids representing UDFs.

### ADQLGEO_FILTER

public static final Predicate<Ivoid> ADQLGEO_FILTER
Includes feature types for Ivoids representing Geometry functions.

### ADQL21MISC_FILTER

public static final Predicate<Ivoid> ADQL21MISC_FILTER
Includes feature types for Ivoids representing optional features.

### NONSTD_FILTER

public static final Predicate<Ivoid> NONSTD_FILTER
Includes feature types for Ivoids representing non-standard features.

## Constructor Details

### AdqlFeature

protected AdqlFeature(String name, String description)
Constructor.

Parameters:
  `name` - feature name
  `description` - plain text description directed at users

## Method Details

### getName

public String getName()
Returns the name of this feature.

Returns:
  function name

### getDescription

public String getDescription()
Returns a plain text description of this feature.

Returns:
  description

### getMathsFunctions

public static AdqlFeature.Function[] getMathsFunctions()
Returns an array of the maths functions defined by ADQL. This is the same for ADQL 2.0 and 2.1, and consists of the contents of Table 1 in Section 2.3 of ADQL 2.1.

Returns:
  maths functions

### getTrigFunctions

public static AdqlFeature.Function[] getTrigFunctions()
Returns an array of the trigonometric functions defined by ADQL. This is the same for ADQL 2.0 and 2.1 and consists of the contents of Table 2 in Section 2.3 of ADQL 2.1.

Returns:
  trig functions

### getGeomFunctions

public static AdqlFeature.Function[] getGeomFunctions(AdqlVersion version, TapCapability tcap)
Returns an array of the standard ADQL 2.0 or 2.1 geometry functions declared by a given TapCapability object. These are defined in Section 4.2 of ADQL 2.1 and Section 2.4 of ADQL 2.0.

Parameters:
  `version` - ADQL version
  `tcap` - capabilities
Returns:
  geometry functions

### getOptionalFunctions

public static AdqlFeature.Function[] getOptionalFunctions(TapCapability tcap)
Returns an array of the ADQL 2.1 optional functions (but not other optional features) declared by a given TapCapability object. These are defined in Section 4 of ADQL 2.1.

Parameters:
  `tcap` - capabilities
Returns:
  optional functions

### getOptionalFeatures

public static AdqlFeature[] getOptionalFeatures(TapCapability tcap)
Returns an array of the ADQL 2.1 optional features (excluding functions) declared by a given TapCapability object. These are defined in Section 4 of ADQL 2.1.

Parameters:
  `tcap` - capabilities
Returns:
  optional features