com.apama.jmon
Class Location

java.lang.Object
  extended by com.apama.jmon.Event
      extended by com.apama.jmon.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
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.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Override Object.equals() to check equality based upon the field values of the instance.
 Location expand(double distance)
          Returns a new Location with the dimensions of this Location expanded by the given distance in each direction (4 directions).
 int hashCode()
          Override Object.hashCode() to provide a hash code that is based upon the field values of the instance.
 java.lang.String toString()
          Override Object.toString() to provide output compatible with the Apama standard representation of location.
 
Methods inherited from class com.apama.jmon.Event
emit, emit, enqueue, enqueueTo, enqueueTo, enqueueTo, getFieldAttributes, getMapFieldTypes, getName, getName, getTime, isExternal, route
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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()


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG