Class Observatory


  • public class Observatory
    extends java.lang.Object
    Observatory Data
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getHeight()
      Get Height
      java.lang.String getId()
      Get identifier
      double getLat()
      Get Latitude
      double getLong()
      Get Longitude
      java.lang.String getName()
      Get Name
      static int getObservatoryCount()
      Return the number of observatories available
      static java.lang.String getObservatoryID​(int i)
      Get the short identifier of an observatory
      static java.lang.String getObservatoryName​(int i)
      Get the name of an observatory
      java.lang.String printPosition()
      Get the longitude, latitude and height as a string
      java.lang.String printPosition​(int ndp)
      Get the longitude, latitude and height as a string
      java.lang.String toString()
      Get the name of the Observatory as a string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getId

        public java.lang.String getId()
        Get identifier
        Returns:
        Code name for Observatory
      • getName

        public java.lang.String getName()
        Get Name
        Returns:
        Full name for Observatory
      • getLong

        public double getLong()
        Get Longitude
        Returns:
        Longitude of Observatory
      • getLat

        public double getLat()
        Get Latitude
        Returns:
        Latitude of Observatory
      • getHeight

        public double getHeight()
        Get Height
        Returns:
        Height of Observatory in metres
      • printPosition

        public java.lang.String printPosition()
        Get the longitude, latitude and height as a string
        Returns:
        Longitude, latitude and height as a string of the form 'E dd mm ss.ss N dd mm ss.ss (Height: nn.nn m)'
      • printPosition

        public java.lang.String printPosition​(int ndp)
        Get the longitude, latitude and height as a string
        Parameters:
        ndp - Number of decimal places in answer
        Returns:
        Longitude, latitude and height as a string of the form 'E dd mm ss.f N dd mm ss.f (Height: nn.f m)' where f is to the required precision
      • toString

        public java.lang.String toString()
        Get the name of the Observatory as a string
        Overrides:
        toString in class java.lang.Object
        Returns:
        Name of the Observatory in the form 'fullname [id]'
      • getObservatoryCount

        public static int getObservatoryCount()
        Return the number of observatories available
        Returns:
        the number of observatories available.
      • getObservatoryName

        public static java.lang.String getObservatoryName​(int i)
        Get the name of an observatory
        Parameters:
        i - index of the observatory
        Returns:
        name of the observatory, null if off limits
      • getObservatoryID

        public static java.lang.String getObservatoryID​(int i)
        Get the short identifier of an observatory
        Parameters:
        i - index of the observatory
        Returns:
        id of the observatory, null if off limits