jsky.catalog
Class BasicQueryArgs

java.lang.Object
  extended by jsky.catalog.BasicQueryArgs
All Implemented Interfaces:
QueryArgs

public class BasicQueryArgs
extends java.lang.Object
implements QueryArgs

Represents the values of the arguments to a catalog query.


Constructor Summary
BasicQueryArgs(Catalog catalog)
          Create a BasicQueryArgs object for the given catalog, with no parameter values (or only default values) set.
 
Method Summary
 Catalog getCatalog()
          Return the catalog we are accesing.
 SearchCondition[] getConditions()
          Return an array of SearchCondition objects indicating the values or range of values to search for.
 java.lang.String getId()
          Return the object id being searched for, or null if none was defined.
 int getMaxRows()
          Returns the max number of rows to be returned from a table query
 java.lang.Object getParamValue(int i)
          Get the value of the ith parameter
 java.lang.Object getParamValue(java.lang.String label)
          Get the value of the named parameter
 double getParamValueAsDouble(java.lang.String label, double defaultValue)
          Get the value of the named parameter as a double.
 int getParamValueAsInt(java.lang.String label, int defaultValue)
          Get the value of the named parameter as an integer.
 java.lang.String getParamValueAsString(java.lang.String label, java.lang.String defaultValue)
          Get the value of the named parameter as a String.
 java.lang.String getQueryType()
          Returns the query type (an optional string, which may be interpreted by some catalogs)
 CoordinateRadius getRegion()
          Return an object describing the query region (center position and radius range), or null if none was defined.
 void setId(java.lang.String id)
          Set the object id to search for.
 void setMaxRows(int maxRows)
          Set the max number of rows to be returned from a table query
 void setParamValue(int i, java.lang.Object value)
          Set the value for the ith parameter
 void setParamValue(java.lang.String label, double value)
          Set the double value for the parameter with the given label
 void setParamValue(java.lang.String label, int value)
          Set the int value for the parameter with the given label
 void setParamValue(java.lang.String label, java.lang.Object value)
          Set the value for the parameter with the given label
 void setParamValueRange(java.lang.String label, double minValue, double maxValue)
          Set the double value for the parameter with the given label
 void setParamValueRange(java.lang.String label, java.lang.Object minValue, java.lang.Object maxValue)
          Set the min and max values for the parameter with the given label
 void setParamValues(java.lang.Object[] values)
          Set the array of parameter values directly.
 void setQueryType(java.lang.String queryType)
          Set the query type (an optional string, which may be interpreted by some catalogs)
 void setRegion(CoordinateRadius region)
          Set the query region (center position and radius range) for the search.
 java.lang.String toString()
          Return a string of the form: arg=value&arg=value, ...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicQueryArgs

public BasicQueryArgs(Catalog catalog)
Create a BasicQueryArgs object for the given catalog, with no parameter values (or only default values) set.

Method Detail

setParamValue

public void setParamValue(int i,
                          java.lang.Object value)
Set the value for the ith parameter

Specified by:
setParamValue in interface QueryArgs

setParamValue

public void setParamValue(java.lang.String label,
                          java.lang.Object value)
Set the value for the parameter with the given label

Specified by:
setParamValue in interface QueryArgs

setParamValueRange

public void setParamValueRange(java.lang.String label,
                               java.lang.Object minValue,
                               java.lang.Object maxValue)
Set the min and max values for the parameter with the given label

Specified by:
setParamValueRange in interface QueryArgs

setParamValue

public void setParamValue(java.lang.String label,
                          int value)
Set the int value for the parameter with the given label

Specified by:
setParamValue in interface QueryArgs

setParamValueRange

public void setParamValueRange(java.lang.String label,
                               double minValue,
                               double maxValue)
Set the double value for the parameter with the given label

Specified by:
setParamValueRange in interface QueryArgs

setParamValue

public void setParamValue(java.lang.String label,
                          double value)
Set the double value for the parameter with the given label

Specified by:
setParamValue in interface QueryArgs

setParamValues

public void setParamValues(java.lang.Object[] values)
Set the array of parameter values directly.

Specified by:
setParamValues in interface QueryArgs

getParamValue

public java.lang.Object getParamValue(int i)
Get the value of the ith parameter

Specified by:
getParamValue in interface QueryArgs

getParamValue

public java.lang.Object getParamValue(java.lang.String label)
Get the value of the named parameter

Specified by:
getParamValue in interface QueryArgs
Parameters:
label - the parameter name or id
Returns:
the value of the parameter, or null if not specified

getParamValueAsInt

public int getParamValueAsInt(java.lang.String label,
                              int defaultValue)
Get the value of the named parameter as an integer.

Specified by:
getParamValueAsInt in interface QueryArgs
Parameters:
label - the parameter label
defaultValue - the default value, if the parameter was not specified
Returns:
the value of the parameter

getParamValueAsDouble

public double getParamValueAsDouble(java.lang.String label,
                                    double defaultValue)
Get the value of the named parameter as a double.

Specified by:
getParamValueAsDouble in interface QueryArgs
Parameters:
label - the parameter label
defaultValue - the default value, if the parameter was not specified
Returns:
the value of the parameter

getParamValueAsString

public java.lang.String getParamValueAsString(java.lang.String label,
                                              java.lang.String defaultValue)
Get the value of the named parameter as a String.

Specified by:
getParamValueAsString in interface QueryArgs
Parameters:
label - the parameter label
defaultValue - the default value, if the parameter was not specified
Returns:
the value of the parameter

getId

public java.lang.String getId()
Return the object id being searched for, or null if none was defined.

Specified by:
getId in interface QueryArgs

setId

public void setId(java.lang.String id)
Set the object id to search for.

Specified by:
setId in interface QueryArgs

getRegion

public CoordinateRadius getRegion()
Return an object describing the query region (center position and radius range), or null if none was defined.

Specified by:
getRegion in interface QueryArgs

setRegion

public void setRegion(CoordinateRadius region)
Set the query region (center position and radius range) for the search.

Specified by:
setRegion in interface QueryArgs

getCatalog

public Catalog getCatalog()
Return the catalog we are accesing.

Specified by:
getCatalog in interface QueryArgs

getConditions

public SearchCondition[] getConditions()
Return an array of SearchCondition objects indicating the values or range of values to search for.

Specified by:
getConditions in interface QueryArgs

getMaxRows

public int getMaxRows()
Returns the max number of rows to be returned from a table query

Specified by:
getMaxRows in interface QueryArgs

setMaxRows

public void setMaxRows(int maxRows)
Set the max number of rows to be returned from a table query

Specified by:
setMaxRows in interface QueryArgs

getQueryType

public java.lang.String getQueryType()
Returns the query type (an optional string, which may be interpreted by some catalogs)

Specified by:
getQueryType in interface QueryArgs

setQueryType

public void setQueryType(java.lang.String queryType)
Set the query type (an optional string, which may be interpreted by some catalogs)

Specified by:
setQueryType in interface QueryArgs

toString

public java.lang.String toString()
Return a string of the form: arg=value&arg=value, ...

Overrides:
toString in class java.lang.Object