Class 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

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MocCoverage​(cds.moc.HealpixImpl hpi)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract cds.moc.HealpixMoc createMoc()
      Constructs the MOC which will define this object's coverage.
      boolean discOverlaps​(double alphaDeg, double deltaDeg, double radiusDeg)
      Indicates whether a given disc on the sphere overlaps, or may overlap with this coverage.
      Coverage.Amount getAmount()
      Returns the amount category for coverage.
      cds.moc.HealpixMoc getMoc()
      Returns the MOC object associated with this footprint.
      void initCoverage()
      Must be called before any of the query methods are used.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MocCoverage

        protected MocCoverage​(cds.moc.HealpixImpl hpi)
        Constructor.
        Parameters:
        hpi - HEALPix implementation to use for calculations
    • Method Detail

      • createMoc

        protected abstract cds.moc.HealpixMoc createMoc()
                                                 throws java.io.IOException
        Constructs the MOC which will define this object's coverage. This method, which may be time-consuming, will be called a maximum of once by the initCoverage() method of MocCoverage, and should not be called by anyone else.
        Returns:
        new MOC defining footprint
        Throws:
        java.io.IOException
      • initCoverage

        public void initCoverage()
                          throws java.io.IOException
        Description copied from interface: Coverage
        Must 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. If Coverage.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:
        initCoverage in interface Coverage
        Throws:
        java.io.IOException
      • getAmount

        public Coverage.Amount getAmount()
        Description copied from interface: Coverage
        Returns 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.
        Specified by:
        getAmount in interface Coverage
        Returns:
        coverage amount category
      • discOverlaps

        public boolean discOverlaps​(double alphaDeg,
                                    double deltaDeg,
                                    double radiusDeg)
        Description copied from interface: Coverage
        Indicates whether a given disc on the sphere overlaps, or may overlap with this coverage. False positives are permitted.
        Specified by:
        discOverlaps in interface Coverage
        Parameters:
        alphaDeg - central longitude in degrees
        deltaDeg - central latitude in degrees
        radiusDeg - 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