Class CustomLocation

java.lang.Object
com.example.skeddly.business.location.CustomLocation
All Implemented Interfaces:
android.os.Parcelable

public class CustomLocation extends Object implements android.os.Parcelable
A single location on Earth, represented by its longitude and latitude.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface android.os.Parcelable

    android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final android.os.Parcelable.Creator<CustomLocation>
     

    Fields inherited from interface android.os.Parcelable

    CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
  • Constructor Summary

    Constructors
    Constructor
    Description
    No-arg constructor for CustomLocation.
    CustomLocation(double latitude, double longitude)
    Construct a new CustomLocation, given the latitude and longitude.
    CustomLocation(double latitude, double longitude, String tag)
    Construct a new CustomLocation, given the latitude and longitude.
    CustomLocation(android.os.Parcel in)
    Construct a new CustomLocation from a Parcel.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    double
    Retrieve the latitude of the location.
    double
    Retrieve the longitude of the location.
    Retrieve the tag associated with the location.
     
    void
    writeToParcel(android.os.Parcel dest, int flags)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<CustomLocation> CREATOR
  • Constructor Details

    • CustomLocation

      public CustomLocation()
      No-arg constructor for CustomLocation. Required by Firebase.
    • CustomLocation

      public CustomLocation(double latitude, double longitude, @Nullable String tag)
      Construct a new CustomLocation, given the latitude and longitude. Stores a tag alongside the given coordinates.
      Parameters:
      latitude - The latitude of the location.
      longitude - The longitude of the location.
      tag - The tag to associate with the location.
    • CustomLocation

      public CustomLocation(double latitude, double longitude)
      Construct a new CustomLocation, given the latitude and longitude.
      Parameters:
      latitude - The latitude of the location.
      longitude - The longitude of the location.
    • CustomLocation

      public CustomLocation(android.os.Parcel in)
      Construct a new CustomLocation from a Parcel.
      Parameters:
      in - The Parcel containing the latitude and longitude.
  • Method Details

    • getLatitude

      public double getLatitude()
      Retrieve the latitude of the location.
      Returns:
      The latitude as a double.
    • getLongitude

      public double getLongitude()
      Retrieve the longitude of the location.
      Returns:
      The longitude as a double.
    • getTag

      @Nullable public String getTag()
      Retrieve the tag associated with the location.
      Returns:
      The tag associated with the location.
    • toString

      @NonNull public String toString()
      Overrides:
      toString in class Object
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable