uk.ac.starlink.ttools.cone
Class DalConeSearcher

java.lang.Object
  extended by uk.ac.starlink.ttools.cone.DalConeSearcher
Direct Known Subclasses:
ServiceConeSearcher, SiaConeSearcher, SsaConeSearcher

public class DalConeSearcher
extends Object

Utility class to aid with implementation of ConeSearcher classes based on contact with remote Data Access Layer-type services. A new instance of this class should be used for each set of related calls to a given service.

Since:
23 Sep 2009
Author:
Mark Taylor

Constructor Summary
DalConeSearcher(String stdName, String stdVers, boolean believeEmpty)
          Constructor.
 
Method Summary
protected  StarTable getConsistentTable(StarTable table)
          Takes a table which is the result of a query to the service handled by this searcher, and returns a table which has compatible column structure to any tables returned by previous calls to this method.
protected  String getInconsistentEmptyAdvice()
          Returns implementation-specific advice to the user about how to swich off trusting the metadata of zero-row tables.
 int getUcd1DecIndex(StarTable table)
          Returns the column index for a column in a given table identified with the UCD POS_EQ_DEC_MAIN.
 int getUcd1RaIndex(StarTable table)
          Returns the column index for a column in a given table identified with the UCD POS_EQ_RA_MAIN.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DalConeSearcher

public DalConeSearcher(String stdName,
                       String stdVers,
                       boolean believeEmpty)
Constructor.

Parameters:
stdName - name of the DAL standard (used in user messages)
stdVers - version of the DAL standard (used in user messages)
believeEmpty - whether empty tables are considered to contain correct metadata
Method Detail

getConsistentTable

protected StarTable getConsistentTable(StarTable table)
                                throws IOException
Takes a table which is the result of a query to the service handled by this searcher, and returns a table which has compatible column structure to any tables returned by previous calls to this method. If the given table looks inconsistent (different number or type of columns), an exception may be thrown or null returned instead.

Parameters:
table - candidate table
Returns:
same table if it's consistent, or possibly null
Throws:
IOException

getUcd1RaIndex

public int getUcd1RaIndex(StarTable table)
Returns the column index for a column in a given table identified with the UCD POS_EQ_RA_MAIN. If it can't be done, some attempt is made to warn and guess an alternative.

Parameters:
table - table
Returns:
index of RA column, or -1 if it can't be found

getUcd1DecIndex

public int getUcd1DecIndex(StarTable table)
Returns the column index for a column in a given table identified with the UCD POS_EQ_DEC_MAIN. If it can't be done, some attempt is made to warn and guess an alternative.

Parameters:
table - table
Returns:
index of Dec column, or -1 if it can't be found

getInconsistentEmptyAdvice

protected String getInconsistentEmptyAdvice()
Returns implementation-specific advice to the user about how to swich off trusting the metadata of zero-row tables. This is issued to the user in the event that zero-row tables are trusted (believeEmpty==true), but subsequent results make it look like they shouldn't be.

Returns:
warning message


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.