|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.catalog.FieldDescAdapter
public class FieldDescAdapter
This class provides a default implementation of the FieldDesc interface, used to describes a catalog field (column or query parameter).
Constructor Summary | |
---|---|
FieldDescAdapter()
Create an empty field description |
|
FieldDescAdapter(java.lang.String name)
Create a field description with the given name |
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 the field may only have a limited number of values, return the number of values, 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 is the max value of a range. |
boolean |
isMin()
Return true if this field is 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. |
void |
setDefaultValue(java.lang.Object v)
Set the default value for this field. |
void |
setDescription(java.lang.String description)
|
void |
setFieldClass(java.lang.Class fieldClass)
|
void |
setFormat(java.lang.String format)
Set a string describing the format of the field, if known |
void |
setId(java.lang.String id)
|
void |
setIsDec(boolean flag)
Set to true if this field contains a world coordinates RA value. |
void |
setIsId(boolean flag)
Set to true if this field contains the unique id |
void |
setIsMax(boolean b)
Set to true if this field is the max value of a range. |
void |
setIsMin(boolean b)
Set to true if this field is the min value of a range. |
void |
setIsRA(boolean flag)
Set to true if this field contains a world coordinates RA value. |
void |
setName(java.lang.String name)
|
void |
setOptions(NameValue[] options)
Set the field options to a list of NameValue objects. |
void |
setType(java.lang.String type)
Set a string describing the semantic type of the field (for example: "ra", "dec", "radius") |
void |
setUnits(java.lang.String units)
Set the units of the field |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FieldDescAdapter()
public FieldDescAdapter(java.lang.String name)
Method Detail |
---|
public void setId(java.lang.String id)
public java.lang.String getId()
FieldDesc
getId
in interface FieldDesc
public void setName(java.lang.String name)
public java.lang.String getName()
FieldDesc
getName
in interface FieldDesc
public void setType(java.lang.String type)
public java.lang.String getType()
getType
in interface FieldDesc
FieldDesc.getFieldClass()
public void setUnits(java.lang.String units)
public java.lang.String getUnits()
getUnits
in interface FieldDesc
public void setFormat(java.lang.String format)
public java.lang.String getFormat()
getFormat
in interface FieldDesc
public void setDescription(java.lang.String description)
public java.lang.String getDescription()
FieldDesc
getDescription
in interface FieldDesc
public void setFieldClass(java.lang.Class fieldClass)
public java.lang.Class getFieldClass()
FieldDesc
getFieldClass
in interface FieldDesc
public java.lang.Object getValue(java.lang.String s)
getValue
in interface FieldDesc
public java.lang.Object getDefaultValue()
getDefaultValue
in interface FieldDesc
public void setDefaultValue(java.lang.Object v)
public void setOptions(NameValue[] options)
public int getNumOptions()
getNumOptions
in interface FieldDesc
public int getDefaultOptionIndex()
getDefaultOptionIndex
in interface FieldDesc
public java.lang.String getOptionName(int i)
getOptionName
in interface FieldDesc
public java.lang.Object getOptionValue(int i)
getOptionValue
in interface FieldDesc
public boolean isValid(java.lang.Object value)
isValid
in interface FieldDesc
public java.net.URL getDocURL()
getDocURL
in interface FieldDesc
public boolean hasLink()
hasLink
in interface FieldDesc
public java.lang.String getLinkText(TableQueryResult tableQueryResult, java.lang.Object value, int row, int column)
getLinkText
in interface FieldDesc
tableQueryResult
- object representing the table datavalue
- the value in the table cellrow
- the row in the tablecolumn
- the column in the table
java.lang.RuntimeException
- if the field is not a linkpublic QueryResult getLinkValue(TableQueryResult tableQueryResult, java.lang.Object value, int row) throws java.net.MalformedURLException
getLinkValue
in interface FieldDesc
tableQueryResult
- object representing the table datavalue
- the value in the table cellrow
- the row in the table
java.net.MalformedURLException
- if the value is not valid URL string
java.lang.RuntimeException
- if the value is not a stringpublic boolean isId()
isId
in interface FieldDesc
public void setIsId(boolean flag)
public boolean isRA()
isRA
in interface FieldDesc
public void setIsRA(boolean flag)
public boolean isDec()
isDec
in interface FieldDesc
public void setIsDec(boolean flag)
public boolean isMin()
isMin
in interface FieldDesc
public void setIsMin(boolean b)
public boolean isMax()
isMax
in interface FieldDesc
public void setIsMax(boolean b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |