Package uk.ac.starlink.vo
Class AbstractAdqlExample
- java.lang.Object
-
- uk.ac.starlink.vo.AbstractAdqlExample
-
- All Implemented Interfaces:
AdqlExample
public abstract class AbstractAdqlExample extends java.lang.Object implements 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 Classes Modifier and Type Class Description static classAbstractAdqlExample.BreakerInterface for configurable line breaking.static classAbstractAdqlExample.TableWithColsEncapsulates metadata for a table and a selection of colum names from it.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAdqlExample(java.lang.String name, java.lang.String description)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AbstractAdqlExample.BreakercreateBreaker(boolean lineBreaks)Returns a breaker instance suitable for a given line break policy.static AdqlExamplecreateDummyExample()Returns a dummy example which never provides any text.static AdqlExamplecreateSimpleExample(java.lang.String name, java.lang.String description, java.lang.String[] textLines)Creates a static example.static AdqlExample[]createSomeExamples()Returns a selection of examples.static AdqlExample[]createTapSchemaExamples()Returns a selection of examples using the TAP_SCHEMA tables.static java.lang.StringformatCoord(double[] skypos, boolean isDec, double dflt)Formats one coordinate from an optional sky position array, falling back to a given default value if necessary.java.lang.StringgetDescription()Returns this example's description.java.net.URLgetInfoUrl()Returns a documentation URL associated with this example if available.java.lang.StringgetName()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 TableMeta[]toTables(TableMeta table, TableMeta[] tables)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
getText
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:AdqlExampleReturns this example's name.- Specified by:
getNamein interfaceAdqlExample- Returns:
- name
-
getDescription
public java.lang.String getDescription()
Description copied from interface:AdqlExampleReturns this example's description.- Specified by:
getDescriptionin interfaceAdqlExample- Returns:
- short description
-
getInfoUrl
public java.net.URL getInfoUrl()
Description copied from interface:AdqlExampleReturns a documentation URL associated with this example if available.- Specified by:
getInfoUrlin interfaceAdqlExample- Returns:
- documentation URL (suitable for browser display), or null
-
createBreaker
public static AbstractAdqlExample.Breaker createBreaker(boolean lineBreaks)
Returns a breaker instance suitable for a given line break policy.- Parameters:
lineBreaks- whether line breaks are required- Returns:
- breaker instance
-
toTables
public static TableMeta[] toTables(TableMeta table, TableMeta[] tables)
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
public static AbstractAdqlExample.TableWithCols[] getRaDecTables(TableMeta[] tables, int max)
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
public static AdqlExample createDummyExample()
Returns a dummy example which never provides any text.- Returns:
- dummy example
-
createSomeExamples
public static AdqlExample[] createSomeExamples()
Returns a selection of examples.- Returns:
- example list
-
createTapSchemaExamples
public static AdqlExample[] createTapSchemaExamples()
Returns a selection of examples using the TAP_SCHEMA tables.- Returns:
- example list
-
createSimpleExample
public static AdqlExample createSimpleExample(java.lang.String name, java.lang.String description, java.lang.String[] textLines)
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
public static java.lang.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.- 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
-
-