public class FieldDescAdapter extends Object implements FieldDesc, Serializable
Constructor and Description |
---|
FieldDescAdapter()
Create an empty field description
|
FieldDescAdapter(String name)
Create a field description with the given name
|
Modifier and Type | Method and Description |
---|---|
int |
getDefaultOptionIndex()
Return the index of the default option, or -1 if there is no default.
|
Object |
getDefaultValue()
Return the default value for this field, or null if there is no default.
|
String |
getDescription()
Return a more detailed description of this field.
|
URL |
getDocURL()
Return a URL pointing to documentation for this field, or null if not available
|
Class |
getFieldClass()
Return the class to use to store values in this field.
|
String |
getFormat()
Return a string describing the format of the field, if known, otherwise null
|
String |
getId()
Return the Id of this field.
|
String |
getLinkText(TableQueryResult tableQueryResult,
Object value,
int row,
int column)
Return the text to display for the link, if there is one, otherwise null.
|
QueryResult |
getLinkValue(TableQueryResult tableQueryResult,
Object value,
int row)
If this field has a link, follow it and return the value it points to as a QueryResult.
|
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.
|
String |
getOptionName(int i)
Return the name of the ith option for this field.
|
Object |
getOptionValue(int i)
Return the value of the ith option for this field.
|
String |
getType()
Return a string describing the semantic type of the field (for example: "ra", "dec", "radius").
|
String |
getUnits()
Return a string describing the units of the field values, if known (for example: "arcmin", "arcsec", "deg")
|
Object |
getValue(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(Object value)
Return true if the given value is valid for this field, otherwise false.
|
void |
setDefaultValue(Object v)
Set the default value for this field.
|
void |
setDescription(String description) |
void |
setFieldClass(Class fieldClass) |
void |
setFormat(String format)
Set a string describing the format of the field, if known
|
void |
setId(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(String name) |
void |
setOptions(NameValue[] options)
Set the field options to a list of NameValue objects.
|
void |
setType(String type)
Set a string describing the semantic type of the field (for example: "ra", "dec", "radius")
|
void |
setUnits(String units)
Set the units of the field
|
public FieldDescAdapter()
public FieldDescAdapter(String name)
public void setId(String id)
public String getId()
FieldDesc
public void setName(String name)
public String getName()
FieldDesc
public void setType(String type)
public String getType()
getType
in interface FieldDesc
FieldDesc.getFieldClass()
public void setUnits(String units)
public String getUnits()
public void setFormat(String format)
public String getFormat()
public void setDescription(String description)
public String getDescription()
FieldDesc
getDescription
in interface FieldDesc
public void setFieldClass(Class fieldClass)
public Class getFieldClass()
FieldDesc
getFieldClass
in interface FieldDesc
public Object getValue(String s)
public Object getDefaultValue()
getDefaultValue
in interface FieldDesc
public void setDefaultValue(Object v)
public void setOptions(NameValue[] options)
public int getNumOptions()
getNumOptions
in interface FieldDesc
public int getDefaultOptionIndex()
getDefaultOptionIndex
in interface FieldDesc
public String getOptionName(int i)
getOptionName
in interface FieldDesc
public Object getOptionValue(int i)
getOptionValue
in interface FieldDesc
public boolean isValid(Object value)
public URL getDocURL()
public boolean hasLink()
public String getLinkText(TableQueryResult tableQueryResult, 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 tableRuntimeException
- if the field is not a linkpublic QueryResult getLinkValue(TableQueryResult tableQueryResult, Object value, int row) throws MalformedURLException
getLinkValue
in interface FieldDesc
tableQueryResult
- object representing the table datavalue
- the value in the table cellrow
- the row in the tableMalformedURLException
- if the value is not valid URL stringRuntimeException
- if the value is not a stringpublic boolean isId()
public void setIsId(boolean flag)
public boolean isRA()
public void setIsRA(boolean flag)
public boolean isDec()
public void setIsDec(boolean flag)
public boolean isMin()
public void setIsMin(boolean b)
public boolean isMax()
public void setIsMax(boolean b)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.