Package geo

Class PointOfInterest


  • public class PointOfInterest
    extends Object
    Immutable datatype representing a place with a name, description, and location.

    PS1 instructions: do NOT change this class.

    • Constructor Detail

      • PointOfInterest

        public PointOfInterest​(Angle latitude,
                               Angle longitude,
                               String name,
                               String description)
        Make a new point of interest (POI).
        Parameters:
        latitude - latitude of the POI, must be a valid latitude as defined in Angle
        longitude - longitude of the POI, must be a valid longitude as defined in Angle
        name - name of the POI, must be nonempty
        description - description of the POI
    • Method Detail

      • latitude

        public Angle latitude()
        Returns:
        latitude of this point of interest
      • longitude

        public Angle longitude()
        Returns:
        longitude of this point of interest
      • name

        public String name()
        Returns:
        nonempty name of this point of interest
      • description

        public String description()
        Returns:
        possibly-empty description of this point of interest
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object