Package uk.ac.starlink.vo
Class AbstractAdqlExample
java.lang.Object
uk.ac.starlink.vo.AbstractAdqlExample
- All Implemented Interfaces:
AdqlExample
Represents a type of example ADQL query.
The query text can be generated as a function of given service metadata.
- Since:
- 29 Mar 2011
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Interface for configurable line breaking.static class
Encapsulates metadata for a table and a selection of colum names from it. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractAdqlExample
(String name, String description) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractAdqlExample.Breaker
createBreaker
(boolean lineBreaks) Returns a breaker instance suitable for a given line break policy.static AdqlExample
Returns a dummy example which never provides any text.static AdqlExample
createSimpleExample
(String name, String description, String[] textLines) Creates a static example.static AdqlExample[]
Returns a selection of examples.static AdqlExample[]
Returns a selection of examples using the TAP_SCHEMA tables.static String
formatCoord
(double[] skypos, boolean isDec, double dflt) Formats one coordinate from an optional sky position array, falling back to a given default value if necessary.Returns this example's description.Returns a documentation URL associated with this example if available.getName()
Returns this example's name.static AbstractAdqlExample.TableWithCols[]
getRaDecTables
(TableMeta[] tables, int max) Identifies tables in a given array which contain RA/Dec positional columns.static boolean
isAdql21
(VersionedLanguage lang) Indicates if a versioned language represents ADQL 2.1 or later.static TableMeta[]
Utility function to turn a single table and a table array into a single array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.starlink.vo.AdqlExample
getAdqlText
-
Constructor Details
-
AbstractAdqlExample
Constructor.- Parameters:
name
- example namedescription
- example short description
-
-
Method Details
-
getName
Description copied from interface:AdqlExample
Returns this example's name.- Specified by:
getName
in interfaceAdqlExample
- Returns:
- name
-
getDescription
Description copied from interface:AdqlExample
Returns this example's description.- Specified by:
getDescription
in interfaceAdqlExample
- Returns:
- short description
-
getInfoUrl
Description copied from interface:AdqlExample
Returns a documentation URL associated with this example if available.- Specified by:
getInfoUrl
in interfaceAdqlExample
- Returns:
- documentation URL (suitable for browser display), or null
-
isAdql21
Indicates if a versioned language represents ADQL 2.1 or later.- Parameters:
lang
- versioned language- Returns:
- true if lang looks like ADQL at least version 2.1
-
createBreaker
Returns a breaker instance suitable for a given line break policy.- Parameters:
lineBreaks
- whether line breaks are required- Returns:
- breaker instance
-
toTables
Utility function to turn a single table and a table array into a single array. The input single table may or may not appear in the input table array; it will not appear twice in the output array.- Parameters:
table
- single input table, or nulltables
- input table array- Returns:
- output table array
-
getRaDecTables
Identifies tables in a given array which contain RA/Dec positional columns.- Parameters:
tables
- candidate table listmax
- the maximum number of output tables required- Returns:
- array of tables with RA/Dec columns
-
createDummyExample
Returns a dummy example which never provides any text.- Returns:
- dummy example
-
createSomeExamples
Returns a selection of examples.- Returns:
- example list
-
createTapSchemaExamples
Returns a selection of examples using the TAP_SCHEMA tables.- Returns:
- example list
-
createSimpleExample
Creates a static example. Only name, description and static example text are supplied.- Parameters:
name
- example namedescription
- example short descriptiontextLines
- lines of ADQL text- Returns:
- example
-
formatCoord
Formats one coordinate from an optional sky position array, falling back to a given default value if necessary.- Parameters:
skypos
- 2-element array giving (RA,Dec) in degrees, or nullisDec
- false to use RA part (element 0), true to use Dec part (element 1)dflt
- default value to use if skypos is null- Returns:
- ADQL-ready numeric string
-