java.lang.Object
jadex.quickstart.cleanerworld.environment.impl.Location
All Implemented Interfaces:
ILocation, Cloneable

public class Location extends Object implements ILocation, Cloneable
Editable Java class for concept Location of cleaner-generated ontology.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Distance, when two locations are considered near.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new Location.
    Location(double x, double y)
    Create a new Location.
  • Method Summary

    Modifier and Type
    Method
    Description
    Clone the object.
    boolean
    Test if two instances are equal.
    double
    Caculate is a location is near this location.
    double
    Get the x of this Location.
    double
    Get the y of this Location.
    int
    Get the hashcode.
    boolean
    Check, if two locations are near to each other using the default tolerance.
    boolean
    isNear(ILocation other, double tolerance)
    Check, if two locations are near to each other.
    void
    setX(double x)
    Set the x of this Location.
    void
    setY(double y)
    Set the y of this Location.
    Get a string representation of this Location.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_TOLERANCE

      public static final double DEFAULT_TOLERANCE
      Distance, when two locations are considered near.
      See Also:
  • Constructor Details

    • Location

      public Location()
      Create a new Location.
    • Location

      public Location(double x, double y)
      Create a new Location.
  • Method Details

    • getX

      public double getX()
      Get the x of this Location. The x-coordinate.
      Specified by:
      getX in interface ILocation
      Returns:
      x
    • setX

      public void setX(double x)
      Set the x of this Location. The x-coordinate.
      Parameters:
      x - the value to be set
    • getY

      public double getY()
      Get the y of this Location. The y-coordinate.
      Specified by:
      getY in interface ILocation
      Returns:
      y
    • setY

      public void setY(double y)
      Set the y of this Location. The y-coordinate.
      Parameters:
      y - the value to be set
    • toString

      public String toString()
      Get a string representation of this Location.
      Overrides:
      toString in class Object
      Returns:
      The string representation.
    • getDistance

      public double getDistance(ILocation other)
      Caculate is a location is near this location.
      Specified by:
      getDistance in interface ILocation
      Returns:
      The distance.
    • isNear

      public boolean isNear(ILocation other)
      Check, if two locations are near to each other using the default tolerance.
      Specified by:
      isNear in interface ILocation
      Returns:
      True, if two locations are near to each other.
    • isNear

      public boolean isNear(ILocation other, double tolerance)
      Check, if two locations are near to each other.
      Parameters:
      tolerance - The distance, when two locations are considered near.
      Returns:
      True, if two locations are near to each other.
    • equals

      public boolean equals(Object o)
      Test if two instances are equal.
      Overrides:
      equals in class Object
      Returns:
      True, if equal.
    • hashCode

      public int hashCode()
      Get the hashcode.
      Overrides:
      hashCode in class Object
    • clone

      public Object clone()
      Clone the object.
      Overrides:
      clone in class Object