Class CustomLocation
java.lang.Object
com.example.skeddly.business.location.CustomLocation
- All Implemented Interfaces:
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
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionNo-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 TypeMethodDescriptionintdoubleRetrieve the latitude of the location.doubleRetrieve the longitude of the location.getTag()Retrieve the tag associated with the location.toString()voidwriteToParcel(android.os.Parcel dest, int flags)
-
Field Details
-
CREATOR
-
-
Constructor Details
-
CustomLocation
public CustomLocation()No-arg constructor for CustomLocation. Required by Firebase. -
CustomLocation
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
Retrieve the tag associated with the location.- Returns:
- The tag associated with the location.
-
toString
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-