Package uk.ac.starlink.ttools.cone
Class MocCoverage
- java.lang.Object
-
- uk.ac.starlink.ttools.cone.MocCoverage
-
- All Implemented Interfaces:
Coverage
- Direct Known Subclasses:
ConeQueryCoverage,UrlMocCoverage
public abstract class MocCoverage extends java.lang.Object implements Coverage
Abstract superclass for Coverage implementations based on MOC (HEALPix Multi-Order Coverage) objects.- Since:
- 9 Jan 2012
- Author:
- Mark Taylor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface uk.ac.starlink.ttools.cone.Coverage
Coverage.Amount
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMocCoverage(cds.moc.HealpixImpl hpi)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract cds.moc.HealpixMoccreateMoc()Constructs the MOC which will define this object's coverage.booleandiscOverlaps(double alphaDeg, double deltaDeg, double radiusDeg)Indicates whether a given disc on the sphere overlaps, or may overlap with this coverage.Coverage.AmountgetAmount()Returns the amount category for coverage.cds.moc.HealpixMocgetMoc()Returns the MOC object associated with this footprint.voidinitCoverage()Must be called before any of the query methods are used.
-
-
-
Method Detail
-
createMoc
protected abstract cds.moc.HealpixMoc createMoc() throws java.io.IOExceptionConstructs the MOC which will define this object's coverage. This method, which may be time-consuming, will be called a maximum of once by theinitCoverage()method ofMocCoverage, and should not be called by anyone else.- Returns:
- new MOC defining footprint
- Throws:
java.io.IOException
-
initCoverage
public void initCoverage() throws java.io.IOExceptionDescription copied from interface:CoverageMust be called before any of the query methods are used. May be time consuming (it may contact an external service). It is legal to call this method multiple times from the same or different threads. IfCoverage.getAmount()returns non-null, this method will return directly. Following a successful or error return of this method,Coverage.getAmount()will return non-null.- Specified by:
initCoveragein interfaceCoverage- Throws:
java.io.IOException
-
getAmount
public Coverage.Amount getAmount()
Description copied from interface:CoverageReturns the amount category for coverage. If the footprint is not ready for use, null is returned. In that case,Coverage.initCoverage()must be called before use.
-
discOverlaps
public boolean discOverlaps(double alphaDeg, double deltaDeg, double radiusDeg)Description copied from interface:CoverageIndicates whether a given disc on the sphere overlaps, or may overlap with this coverage. False positives are permitted.- Specified by:
discOverlapsin interfaceCoverage- Parameters:
alphaDeg- central longitude in degreesdeltaDeg- central latitude in degreesradiusDeg- radius in degrees- Returns:
- false if the given disc definitely does not overlap this footprint; otherwise true
-
getMoc
public cds.moc.HealpixMoc getMoc()
Returns the MOC object associated with this footprint.- Returns:
- moc
-
-