|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.cone.ConeErrorPolicy
public abstract class ConeErrorPolicy
Defines how errors are treated during a multiple cone search operation.
An instance of this class should be applied to a ConeSearcher
object prior to use in order to make it obey the instance's policy
on reacting to errors in the cone searcher's
ConeSearcher.performSearch(double, double, double)
method.
Could one write a more general class which does this one's job using proxies?
Field Summary | |
---|---|
static ConeErrorPolicy |
ABORT
An error during a cone search results in a failure of the task. |
static ConeErrorPolicy |
IGNORE
Errors during cone searches are treated as if the search had returned with no results. |
static ConeErrorPolicy |
RETRY
If an error occurs during a cone search it is retried until a non-error result is obtained. |
Constructor Summary | |
---|---|
protected |
ConeErrorPolicy(String name)
Constructor. |
Method Summary | |
---|---|
static ConeErrorPolicy |
addAdvice(ConeErrorPolicy policy,
String advice)
Returns a new policy which behaves like a base one, but provides a supplied message in the IOException which is thrown if the search fails. |
abstract ConeSearcher |
adjustConeSearcher(ConeSearcher base)
Apply this method to a basic cone searcher to obtain a new one which uses the error-handling policy defined by this policy object. |
static ConeErrorPolicy |
createRetryPolicy(String name,
int nTry)
Constructs an error policy which will retry the search a fixed number of times. |
String |
toString()
Returns this object's name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ConeErrorPolicy ABORT
public static final ConeErrorPolicy IGNORE
public static final ConeErrorPolicy RETRY
Constructor Detail |
---|
protected ConeErrorPolicy(String name)
name
- policy nameMethod Detail |
---|
public String toString()
toString
in class Object
public abstract ConeSearcher adjustConeSearcher(ConeSearcher base)
base
- base cone searcher
base
with possibly
modified error handlingpublic static ConeErrorPolicy createRetryPolicy(String name, int nTry)
name
- policy namenTry
- maximum number of attempts;
if <=0 will retry indefinitely
public static ConeErrorPolicy addAdvice(ConeErrorPolicy policy, String advice)
policy
- base policyadvice
- message of exception on failure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |