jsky.catalog
Class TestCatalog

java.lang.Object
  extended by jsky.catalog.TestCatalog
All Implemented Interfaces:
java.lang.Cloneable, Catalog, QueryResult

public class TestCatalog
extends java.lang.Object
implements Catalog

Used for testing. This class provides a dummy catalog class that can be used for testing.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Field Summary
 
Fields inherited from interface jsky.catalog.Catalog
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER
 
Constructor Summary
TestCatalog()
           
 
Method Summary
 java.lang.Object clone()
          Implementation of the clone method (makes a shallow copy).
 java.lang.String getDescription()
          Return a description of the catalog, or null if not available
 java.net.URL getDocURL()
          Return a URL pointing to documentation for the catalog, or null if not available
 java.lang.String getId()
          Return the Id or short name of the catalog
 java.lang.String getName()
          Return the name of the catalog
 int getNumParams()
          If this catalog can be querried, return the number of query parameters that it accepts
 FieldDesc getParamDesc(int i)
          Return a description of the ith query parameter
 FieldDesc getParamDesc(java.lang.String name)
          Return a description of the named query parameter
 CatalogDirectory getParent()
          Return a reference to the parent catalog directory, or null if not known.
 Catalog[] getPath()
          Return an array of Catalog or CatalogDirectory objects representing the path from the root catalog directory to this catalog.
 java.lang.String getTitle()
          Return a string to display as a title for the catalog in a user interface
 java.lang.String getType()
          Return the catalog type (normally one of the Catalog constants: CATALOG, ARCHIVE, DIRECTORY, LOCAL, IMAGE_SERVER)
 boolean isImageServer()
          Return true if this object represents an image server.
 boolean isLocal()
          Return true if this is a local catalog, and false if it requires network access or if a query could hang.
 QueryResult query(QueryArgs queryArgs)
          Query the catalog using the given arguments and return the result.
 void setName(java.lang.String name)
          Set the name of the catalog
 void setParent(CatalogDirectory catDir)
          Set the parent catalog directory
 void setRegionArgs(QueryArgs queryArgs, CoordinateRadius region)
          Given a description of a region of the sky (center point and radius range), and the current query argument settings, set the values of the corresponding query parameters.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestCatalog

public TestCatalog()
Method Detail

clone

public java.lang.Object clone()
Implementation of the clone method (makes a shallow copy).

Specified by:
clone in interface Catalog
Overrides:
clone in class java.lang.Object

setName

public void setName(java.lang.String name)
Set the name of the catalog

Specified by:
setName in interface Catalog

getName

public java.lang.String getName()
Return the name of the catalog

Specified by:
getName in interface Catalog

getId

public java.lang.String getId()
Return the Id or short name of the catalog

Specified by:
getId in interface Catalog

getTitle

public java.lang.String getTitle()
Return a string to display as a title for the catalog in a user interface

Specified by:
getTitle in interface Catalog

getDescription

public java.lang.String getDescription()
Return a description of the catalog, or null if not available

Specified by:
getDescription in interface Catalog

getDocURL

public java.net.URL getDocURL()
Return a URL pointing to documentation for the catalog, or null if not available

Specified by:
getDocURL in interface Catalog

getNumParams

public int getNumParams()
If this catalog can be querried, return the number of query parameters that it accepts

Specified by:
getNumParams in interface Catalog

getParamDesc

public FieldDesc getParamDesc(int i)
Return a description of the ith query parameter

Specified by:
getParamDesc in interface Catalog

getParamDesc

public FieldDesc getParamDesc(java.lang.String name)
Return a description of the named query parameter

Specified by:
getParamDesc in interface Catalog

setRegionArgs

public void setRegionArgs(QueryArgs queryArgs,
                          CoordinateRadius region)
Given a description of a region of the sky (center point and radius range), and the current query argument settings, set the values of the corresponding query parameters.

Specified by:
setRegionArgs in interface Catalog
Parameters:
queryArgs - (in/out) describes the query arguments
region - (in) describes the query region (center and radius range)

isLocal

public boolean isLocal()
Return true if this is a local catalog, and false if it requires network access or if a query could hang. A local catalog query is run in the event dispatching thread, while others are done in a separate thread.

Specified by:
isLocal in interface Catalog

isImageServer

public boolean isImageServer()
Return true if this object represents an image server.

Specified by:
isImageServer in interface Catalog

query

public QueryResult query(QueryArgs queryArgs)
                  throws java.io.IOException
Query the catalog using the given arguments and return the result. The result of a query may be any class that implements the QueryResult interface. It is up to the calling class to interpret and display the result. In the general case where the result is downloaded via HTTP, The URLQueryResult class may be used.

Specified by:
query in interface Catalog
Parameters:
queryArgs - An object describing the query arguments.
Returns:
An object describing the result of the query.
Throws:
java.io.IOException

getType

public java.lang.String getType()
Return the catalog type (normally one of the Catalog constants: CATALOG, ARCHIVE, DIRECTORY, LOCAL, IMAGE_SERVER)

Specified by:
getType in interface Catalog

setParent

public void setParent(CatalogDirectory catDir)
Set the parent catalog directory

Specified by:
setParent in interface Catalog

getParent

public CatalogDirectory getParent()
Return a reference to the parent catalog directory, or null if not known.

Specified by:
getParent in interface Catalog

getPath

public Catalog[] getPath()
Return an array of Catalog or CatalogDirectory objects representing the path from the root catalog directory to this catalog.

Specified by:
getPath in interface Catalog