Package com.targomo.client.api.geo
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.
-
Field Summary
Fields inherited from class com.targomo.client.api.geo.AbstractLocation
id, properties -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCoordinate(String id, double x, double y, LocationProperties locationProperties) Generate a Coordinate with an ID along with X and Y values. -
Method Summary
Modifier and TypeMethodDescriptionbooleandoublegetX()Get the value of coordinate in X-axis.doublegetY()Get the value of coordinate in Y-axis.inthashCode()voidsetTravelType(TravelType travelType) Set the travel type to use when routing.voidsetX(double x) Set the value of coordinate in X-axis.voidsetY(double y) Set the value of coordinate in Y-axis.toString()Returns a JSON String representation of the Coordinate with ID, x and y values.Methods inherited from class com.targomo.client.api.geo.AbstractLocation
getId, getProperties, setId, setPropertiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.targomo.client.api.geo.Location
getId, getProperties, getTravelTypes, setId, setProperties, setTravelTypes
-
Constructor Details
-
AbstractCoordinate
public AbstractCoordinate() -
AbstractCoordinate
Generate a Coordinate with an ID along with X and Y values.- Parameters:
id- ID to associate with the target coordinatex- X value of coordinatey- Y value of coordinatelocationProperties- properties of coordinate
-
-
Method Details
-
getX
public double getX()Get the value of coordinate in X-axis.- Specified by:
getXin interfaceCoordinate- Returns:
- Value in x-axis
-
setX
public void setX(double x) Set the value of coordinate in X-axis.- Specified by:
setXin interfaceCoordinate- Parameters:
x- X value to be set
-
getY
public double getY()Get the value of coordinate in Y-axis.- Specified by:
getYin interfaceCoordinate- Returns:
- Value in y-axis
-
setY
public void setY(double y) Set the value of coordinate in Y-axis.- Specified by:
setYin interfaceCoordinate- Parameters:
y- Y value to be set
-
setTravelType
Set the travel type to use when routing.- Specified by:
setTravelTypein interfaceLocation- Parameters:
travelType- Travel type to be associated with the coordinate.
-
toString
Returns a JSON String representation of the Coordinate with ID, x and y values. -
equals
-
hashCode
public int hashCode()
-