@MappedSuperclass public abstract class AbstractCoordinate extends Object implements Coordinate
| Constructor and Description |
|---|
AbstractCoordinate() |
AbstractCoordinate(String id,
double x,
double y)
Generate a Coordinate with an ID along with X and Y values.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getId()
Get the ID associated with the coordinate.
|
abstract TravelType |
getTravelType()
Get TravelType of coordinate.
|
double |
getX()
Get the value of coordinate in X-axis.
|
double |
getY()
Get the value of coordinate in Y-axis.
|
int |
hashCode() |
void |
setId(String id)
Assign an ID to the coordinate
|
abstract void |
setTravelType(TravelType travelType)
Set a travel type for the coordinate.
|
void |
setX(double x)
Set the value of coordinate in X-axis.
|
void |
setY(double y)
Set the value of coordinate in Y-axis.
|
String |
toString()
Returns a JSON String representation of the Coordinate with ID, x and y values.
|
public AbstractCoordinate()
public AbstractCoordinate(String id, double x, double y)
id - ID to associate with the target coordinatex - X value of targety - Y value of targetpublic abstract TravelType getTravelType()
getTravelType in interface Coordinatepublic abstract void setTravelType(TravelType travelType)
setTravelType in interface CoordinatetravelType - Travel type to be associated with the coordinate.public String getId()
getId in interface Coordinatepublic void setId(String id)
setId in interface Coordinateid - ID to be assignedpublic double getX()
getX in interface Coordinatepublic void setX(double x)
setX in interface Coordinatex - X value to be setpublic double getY()
getY in interface Coordinatepublic void setY(double y)
setY in interface Coordinatey - Y value to be setpublic String toString()
Copyright © 2017. All rights reserved.