Class Location

  • All Implemented Interfaces:
    java.lang.Cloneable

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

      Fields 
      Modifier and Type Field Description
      static double DEFAULT_TOLERANCE
      Distance, when two locations are considered near.
      protected double x
      The x-coordinate.
      protected double y
      The y-coordinate.
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Clone the object.
      boolean equals​(java.lang.Object o)
      Test if two instances are equal.
      double getDistance​(Location other)
      Caculate is a location is near this location.
      double getX()
      Get the x of this Location.
      double getY()
      Get the y of this Location.
      int hashCode()
      Get the hashcode.
      boolean isNear​(Location other)
      Check, if two locations are near to each other using the default tolerance.
      boolean isNear​(Location 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.
      java.lang.String toString()
      Get a string representation of this Location.
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_TOLERANCE

        public static final double DEFAULT_TOLERANCE
        Distance, when two locations are considered near.
        See Also:
        Constant Field Values
      • x

        protected double x
        The x-coordinate.
      • y

        protected double y
        The y-coordinate.
    • Constructor Detail

      • Location

        public Location()
        Create a new Location.
      • Location

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

      • getX

        public double getX()
        Get the x of this Location. The x-coordinate.
        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.
        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 java.lang.String toString()
        Get a string representation of this Location.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.
      • getDistance

        public double getDistance​(Location other)
        Caculate is a location is near this location.
        Returns:
        The distance.
      • isNear

        public boolean isNear​(Location other)
        Check, if two locations are near to each other using the default tolerance.
        Returns:
        True, if two locations are near to each other.
      • isNear

        public boolean isNear​(Location 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​(java.lang.Object o)
        Test if two instances are equal.
        Overrides:
        equals in class java.lang.Object
        Returns:
        True, if equal.
      • hashCode

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

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