Class DefaultSourceCoordinate

All Implemented Interfaces:
Coordinate, Location

@Entity public class DefaultSourceCoordinate extends AbstractCoordinate
Default implementation for storing source coordinates. Basically a AbstractCoordinate with TravelType, specialized to be used as a target.
  • Constructor Details

    • DefaultSourceCoordinate

      public DefaultSourceCoordinate()
    • DefaultSourceCoordinate

      public DefaultSourceCoordinate(String id, double x, double y, List<TravelType> travelTypes, LocationProperties locationProperties)
    • DefaultSourceCoordinate

      public DefaultSourceCoordinate(String id, double x, double y, TravelType travelType, LocationProperties locationProperties)
      Generate Source coordinate with a TravelType as well as ID, X and Y values.
      Parameters:
      id - ID to associate with the target coordinate
      x - X value of target
      y - Y value of target
      travelType - TravelType to be associated with the coordinate
      locationProperties - properties for this source
    • DefaultSourceCoordinate

      public DefaultSourceCoordinate(String id, double x, double y, TravelType travelType)
      Generate Source coordinate with a TravelType as well as ID, X and Y values.
      Parameters:
      id - ID to associate with the target coordinate
      x - X value of target
      y - Y value of target
      travelType - TravelType to be associated with the coordinate
    • DefaultSourceCoordinate

      public DefaultSourceCoordinate(String id, double x, double y)
      Generate Source coordinate with ID, X and Y values with no travel type. Travel type will be set to null.
      Parameters:
      id - ID to associate with the target coordinate
      x - X value of target
      y - Y value of target
    • DefaultSourceCoordinate

      public DefaultSourceCoordinate(String id, double x, double y, LocationProperties locationProperties)
      Generate Source coordinate with ID, X and Y values with no travel type. Travel type will be set to null.
      Parameters:
      id - ID to associate with the target coordinate
      x - X value of target
      y - Y value of target
      locationProperties -
  • Method Details

    • getIdentifier

      public long getIdentifier()
      The main problem with this identifier is that we need it for hibernate since it's not able to work without an ID. But source coordinates have perse no real identifier since the same coordinate could come from multiple clients and have different lat/lng/traveltype.
      Returns:
      this database unique identifier of this source point
    • setIdentifier

      public void setIdentifier(long id)
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class AbstractCoordinate