Class AbstractCoordinate

java.lang.Object
com.targomo.client.api.geo.AbstractLocation
com.targomo.client.api.geo.AbstractCoordinate
All Implemented Interfaces:
Coordinate, Location
Direct Known Subclasses:
DefaultSourceCoordinate, DefaultTargetCoordinate

@MappedSuperclass public abstract class AbstractCoordinate extends AbstractLocation implements Coordinate
Simple abstract class to use for storing coordinates with IDs and travel types.
  • Constructor Details

    • AbstractCoordinate

      public AbstractCoordinate()
    • AbstractCoordinate

      public AbstractCoordinate(String id, double x, double y, LocationProperties locationProperties)
      Generate a Coordinate with an ID along with X and Y values.
      Parameters:
      id - ID to associate with the target coordinate
      x - X value of coordinate
      y - Y value of coordinate
      locationProperties - properties of coordinate
  • Method Details

    • getX

      public double getX()
      Get the value of coordinate in X-axis.
      Specified by:
      getX in interface Coordinate
      Returns:
      Value in x-axis
    • setX

      public void setX(double x)
      Set the value of coordinate in X-axis.
      Specified by:
      setX in interface Coordinate
      Parameters:
      x - X value to be set
    • getY

      public double getY()
      Get the value of coordinate in Y-axis.
      Specified by:
      getY in interface Coordinate
      Returns:
      Value in y-axis
    • setY

      public void setY(double y)
      Set the value of coordinate in Y-axis.
      Specified by:
      setY in interface Coordinate
      Parameters:
      y - Y value to be set
    • setTravelType

      public void setTravelType(TravelType travelType)
      Set the travel type to use when routing.
      Specified by:
      setTravelType in interface Location
      Parameters:
      travelType - Travel type to be associated with the coordinate.
    • toString

      public String toString()
      Returns a JSON String representation of the Coordinate with ID, x and y values.
      Overrides:
      toString in class Object
      Returns:
      JSON representation of the coordinate
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object