com.ijchart.xychart.render.category.outlier
Class Outlier

java.lang.Object
  extended by com.ijchart.xychart.render.category.outlier.Outlier
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class Outlier
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable, java.lang.Cloneable

Title: IJChart

Represents one outlier in the box and whisker plot. All the coordinates in this class are in Java2D space.

Description: a chart library for the Java(tm) platform.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Constructor Summary
Outlier(double xCoord, double yCoord, double radius)
           Constructs an outlier item consisting of a point and the radius of the outlier ellipse.
 
Method Summary
 java.lang.Object clone()
           Creates and returns a copy of this object.
 int compareTo(java.lang.Object o)
           Compares this object with the specified object for order, based on the outlier's point.
 boolean equals(java.lang.Object obj)
           Tests this instance for equality with an arbitrary object.
 java.awt.geom.Point2D getPoint()
           Returns the xy coordinates of the bounding box containing the outlier ellipse.
 double getRadius()
           Returns the radius of the outlier ellipse.
 double getX()
           Returns the x coordinate of the bounding box containing the outlier ellipse.
 double getY()
           Returns the y coordinate of the bounding box containing the outlier ellipse.
 int hashCode()
           Returns a hash code value for the object.
 boolean overlaps(Outlier other)
           Returns a true if outlier is overlapped and false if it is not.
 void setPoint(java.awt.geom.Point2D point)
           Sets the xy coordinates of the bounding box containing the outlier ellipse.
 void setRadius(double radius)
           Sets the radius of the outlier ellipse.
 java.lang.String toString()
           Returns a textual representation of the outlier.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Outlier

public Outlier(double xCoord,
               double yCoord,
               double radius)
Constructs an outlier item consisting of a point and the radius of the outlier ellipse.

Parameters:
xCoord - double The x coordinate of the point.
yCoord - double The y coordinate of the point.
radius - double The radius of the ellipse.
Method Detail

getPoint

public java.awt.geom.Point2D getPoint()
Returns the xy coordinates of the bounding box containing the outlier ellipse.

Returns:
Point2D The location of the outlier ellipse.

setPoint

public void setPoint(java.awt.geom.Point2D point)
Sets the xy coordinates of the bounding box containing the outlier ellipse.

Parameters:
point - Point2D The location.

getX

public double getX()
Returns the x coordinate of the bounding box containing the outlier ellipse.

Returns:
double The x coordinate.

getY

public double getY()
Returns the y coordinate of the bounding box containing the outlier ellipse.

Returns:
double The y coordinate.

getRadius

public double getRadius()
Returns the radius of the outlier ellipse.

Returns:
double The radius.

setRadius

public void setRadius(double radius)
Sets the radius of the outlier ellipse.

Parameters:
radius - The new radius.

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order, based on the outlier's point.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the Object to be compared.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

overlaps

public boolean overlaps(Outlier other)
Returns a true if outlier is overlapped and false if it is not. Overlapping is determined by the respective bounding boxes plus a small margin.

Parameters:
other - the other outlier.
Returns:
A boolean indicating whether or not an overlap has occurred.

equals

public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
int A hash code value for this object.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

toString

public java.lang.String toString()
Returns a textual representation of the outlier.

Overrides:
toString in class java.lang.Object
Returns:
A String representing the outlier.