jsky.catalog
Interface FieldDesc

All Known Implementing Classes:
FieldDescAdapter

public interface FieldDesc

This interface describes a catalog field, which may be an input field, such as a query parameter, or an output field, such as a table column description. Any of the methods may return null, if the information is not known, although normally, at least a field name should be provided. To save work, classes that implement this interface may be derived from FieldDescAdatper and override as many of the methods as needed.


Method Summary
 int getDefaultOptionIndex()
          Return the index of the default option, or -1 if there is no default.
 java.lang.Object getDefaultValue()
          Return the default value for this field, or null if there is no default.
 java.lang.String getDescription()
          Return a more detailed description of this field.
 java.net.URL getDocURL()
          Return a URL pointing to documentation for this field, or null if not available
 java.lang.Class getFieldClass()
          Return the class to use to store values in this field.
 java.lang.String getFormat()
          Return a string describing the format of the field, if known, otherwise null
 java.lang.String getId()
          Return the Id of this field.
 java.lang.String getLinkText(TableQueryResult tableQueryResult, java.lang.Object value, int row, int column)
          Return the text to display for the link, if there is one, otherwise null.
 QueryResult getLinkValue(TableQueryResult tableQueryResult, java.lang.Object value, int row)
          If this field has a link, follow it and return the value it points to as a QueryResult.
 java.lang.String getName()
          Return the name of this field.
 int getNumOptions()
          If a list of options was defined for the field, return the number of options, otherwise 0.
 java.lang.String getOptionName(int i)
          Return the name of the ith option for this field.
 java.lang.Object getOptionValue(int i)
          Return the value of the ith option for this field.
 java.lang.String getType()
          Return a string describing the semantic type of the field (for example: "ra", "dec", "radius").
 java.lang.String getUnits()
          Return a string describing the units of the field values, if known (for example: "arcmin", "arcsec", "deg")
 java.lang.Object getValue(java.lang.String s)
          Parse the given string into the correct class type for this field and return the value.
 boolean hasLink()
          Return true if the field has a link pointing to more data.
 boolean isDec()
          Return true if this field contains a world coordinates Dec value.
 boolean isId()
          Return true if this field is the unique id.
 boolean isMax()
          Return true if this field represents the max value of a range.
 boolean isMin()
          Return true if this field represents the min value of a range.
 boolean isRA()
          Return true if this field contains a world coordinates RA value.
 boolean isValid(java.lang.Object value)
          Return true if the given value is valid for this field, otherwise false.
 

Method Detail

getId

java.lang.String getId()
Return the Id of this field.


getName

java.lang.String getName()
Return the name of this field.


getType

java.lang.String getType()
Return a string describing the semantic type of the field (for example: "ra", "dec", "radius").

See Also:
getFieldClass()

getUnits

java.lang.String getUnits()
Return a string describing the units of the field values, if known (for example: "arcmin", "arcsec", "deg")


getFormat

java.lang.String getFormat()
Return a string describing the format of the field, if known, otherwise null


getDescription

java.lang.String getDescription()
Return a more detailed description of this field.


getDocURL

java.net.URL getDocURL()
Return a URL pointing to documentation for this field, or null if not available


hasLink

boolean hasLink()
Return true if the field has a link pointing to more data.


getLinkText

java.lang.String getLinkText(TableQueryResult tableQueryResult,
                             java.lang.Object value,
                             int row,
                             int column)
Return the text to display for the link, if there is one, otherwise null.

Parameters:
tableQueryResult - object representing the table data
value - the value in the table cell
row - the row in the table
column - the column in the table
Throws:
java.lang.RuntimeException - if the field is not a link

getLinkValue

QueryResult getLinkValue(TableQueryResult tableQueryResult,
                         java.lang.Object value,
                         int row)
                         throws java.net.MalformedURLException
If this field has a link, follow it and return the value it points to as a QueryResult.

Parameters:
tableQueryResult - object representing the table data
value - the value in the table cell
row - the row in the table
Throws:
java.net.MalformedURLException - if the value is not valid URL string
java.lang.RuntimeException - if the value is not a string

getFieldClass

java.lang.Class getFieldClass()
Return the class to use to store values in this field.


getValue

java.lang.Object getValue(java.lang.String s)
Parse the given string into the correct class type for this field and return the value.


getDefaultValue

java.lang.Object getDefaultValue()
Return the default value for this field, or null if there is no default.


getNumOptions

int getNumOptions()
If a list of options was defined for the field, return the number of options, otherwise 0.


getDefaultOptionIndex

int getDefaultOptionIndex()
Return the index of the default option, or -1 if there is no default.


getOptionName

java.lang.String getOptionName(int i)
Return the name of the ith option for this field.


getOptionValue

java.lang.Object getOptionValue(int i)
Return the value of the ith option for this field.


isValid

boolean isValid(java.lang.Object value)
Return true if the given value is valid for this field, otherwise false.


isId

boolean isId()
Return true if this field is the unique id.


isRA

boolean isRA()
Return true if this field contains a world coordinates RA value.


isDec

boolean isDec()
Return true if this field contains a world coordinates Dec value.


isMin

boolean isMin()
Return true if this field represents the min value of a range.


isMax

boolean isMax()
Return true if this field represents the max value of a range.