Class Location

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class Location
    extends Event
    implements java.lang.Cloneable
    The Location class provides a Java representation of the MonitorScript location type. It defines a rectangular region by specifying the coordinates of two diagonally opposite corners.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Location()
      Default constructor - creates a point location at [0,0].
      Location​(double x1, double y1, double x2, double y2)
      Full argument constructor to create a rectangular region.
    • Constructor Detail

      • Location

        public Location()
        Default constructor - creates a point location at [0,0]. Simply calls this(0.0, 0.0, 0.0, 0.0)
      • Location

        public Location​(double x1,
                        double y1,
                        double x2,
                        double y2)
        Full argument constructor to create a rectangular region. To create a point (region with zero area), simply specify parameters where x1==x2 and y1==y2.
    • Method Detail

      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class Event
      • expand

        public Location expand​(double distance)
        Returns a new Location with the dimensions of this Location expanded by the given distance in each direction (4 directions).
        Parameters:
        distance - The distance to expand by in each direction.
        Returns:
        A new Location instance expanded as specified.
      • toString

        public java.lang.String toString()
        Override Object.toString() to provide output compatible with the Apama standard representation of location.
        Overrides:
        toString in class Event
        Returns:
        A String of the form "(x1,y1,x2,y2)".
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from class: Event
        Override Object.equals() to check equality based upon the field values of the instance.
        Overrides:
        equals in class Event
        Parameters:
        obj - The object to be compared for equality.
        Returns:
        True if the instances are equal.
        See Also:
        Object.equals(Object)
      • hashCode

        public int hashCode()
        Description copied from class: Event
        Override Object.hashCode() to provide a hash code that is based upon the field values of the instance.
        Overrides:
        hashCode in class Event
        Returns:
        Hash code for the Event instance.
        See Also:
        Object.hashCode()