Class Nearby


  • public class Nearby
    extends java.lang.Object
    The nearby class with locations and distance.
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      ConstructorDescription
      Nearby​(UserLocation location, double distance, boolean isElevationUsed)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanequals​(java.lang.Object o)
      Checks for equality.
      doublegetDistance()
      Gets the distance measured to the user in question.
      UserLocationgetUserLocationHistory()
      Gets the user location.
      booleanisElevationUsed()
      Flag indicating elevation is taken into account (if present).
      java.lang.StringtoString()
      String representation of the class.
      • Methods inherited from class java.lang.Object

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

      • Nearby

        public Nearby​(UserLocation location,
                      double distance,
                      boolean isElevationUsed)
        Constructor.
        Parameters:
        location - The user location.
        distance - The distance in meters.
        isElevationUsed - Flag indicating elevation is taken into account (if present).
        Throws:
        java.lang.NullPointerException - If userLocation is null.
    • Method Detail

      • getUserLocationHistory

        public UserLocation getUserLocationHistory()
        Gets the user location.
        Returns:
        The user location instance.
      • getDistance

        public double getDistance()
        Gets the distance measured to the user in question.
        Returns:
        A distance in meters, perhaps taking into account the elevation.
      • isElevationUsed

        public boolean isElevationUsed()
        Flag indicating elevation is taken into account (if present).
      • equals

        public boolean equals​(java.lang.Object o)
        Checks for equality.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The object to compare with.
        Returns:
        When equals, false otherwise.
      • toString

        public java.lang.String toString()
        String representation of the class.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string with user and distance.