com.ijchart.xychart.data
Class BoxAndWhiskerData

java.lang.Object
  extended by com.ijchart.xychart.data.AbstractChartData
      extended by com.ijchart.xychart.data.BoxAndWhiskerData
All Implemented Interfaces:
IChartData, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
IntervalXBoxAndWhiskerData

public class BoxAndWhiskerData
extends AbstractChartData
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

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

BoxAndWhisker ChartData object,this class is immutable.

Copyright: Copyright (c) 2013

Company:

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

Field Summary
 
Fields inherited from class com.ijchart.xychart.data.AbstractChartData
DATE_MASK_LONG
 
Constructor Summary
BoxAndWhiskerData()
           Constructor.
 
Method Summary
 void addValue(java.lang.Number value)
           Add a value.
 void addValues(java.lang.Number[] values)
           Add a value array.
 double calculateQ3Value(java.util.List values)
           Calculates the third quartile for a list of numbers in ascending order.
 void clearValues()
           Remove all values.
 java.lang.Object clone()
           Creates and returns a copy of this object.
 int compareTo(java.lang.Object o)
           Implements the compareTo() method of interface Comparable.
 boolean equals(java.lang.Object obj)
           Tests this instance for equality with an arbitrary object.
 java.lang.String getAreaFunctionArguments()
           Returns the function arguments of hotspot area.
 java.lang.String getAreaURLFragment()
           Returns the url for hotspot area.
 java.lang.String getLabelText()
           Returns the label text.
 double getMaxOutlier()
           Returns the maximum outlier.
 double getMaxRegularValue()
           Returns the maximum regular value.
 double getMean()
           Returns the mean.
 double getMedian()
           Returns the median.
 double getMinOutlier()
           Returns the minimum outlier.
 double getMinRegularValue()
           Returns the minimum regular value.
 java.util.List getOutliers()
           Returns the outliers.
 double getQ1()
           Returns the first quarter.
 double getQ3()
           Returns the third quarter.
 java.util.List getValues()
           Returns the list of values,and is unmodifiable.
 int hashCode()
           Returns a hash code value for the object.
 java.lang.Object removeValue(int index)
           Removes the element at the specified position in this list.
 java.lang.String toString()
           Returns a string representation of the object.
 
Methods inherited from class com.ijchart.xychart.data.AbstractChartData
formatDate, formatDateForFunction, formatNumber, formatNumber, formatNumberForFunction, formatNumberForFunction, getDateFormat, getNumberFormat, setDateFormat, setNumberFormat
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoxAndWhiskerData

public BoxAndWhiskerData()
Constructor.

Method Detail

addValue

public void addValue(java.lang.Number value)
Add a value.

Parameters:
value - Number A value.

addValues

public void addValues(java.lang.Number[] values)
Add a value array.

Parameters:
values - Number[] A value array (null not permitted).

removeValue

public java.lang.Object removeValue(int index)
Removes the element at the specified position in this list.

Parameters:
index - int The index of the element to removed..
Returns:
Object The element that was removed from the list.
Throws:
java.lang.IndexOutOfBoundsException - If index out of range (index < 0 || index >= size()).

clearValues

public void clearValues()
Remove all values.


getValues

public java.util.List getValues()
Returns the list of values,and is unmodifiable.

Returns:
List The list of values,and is unmodifiable.

getMean

public double getMean()
Returns the mean.

Returns:
double The mean.

getMedian

public double getMedian()
Returns the median.

Returns:
double The median (possibly null).

getQ1

public double getQ1()
Returns the first quarter.

Returns:
double The first quartile.

getQ3

public double getQ3()
Returns the third quarter.

Returns:
double The third quartile.

getMinRegularValue

public double getMinRegularValue()
Returns the minimum regular value.

Returns:
double The minimum regular value.

getMaxRegularValue

public double getMaxRegularValue()
Returns the maximum regular value.

Returns:
double The maximum regular value.

getMinOutlier

public double getMinOutlier()
Returns the minimum outlier.

Returns:
double The minimum outlier.

getMaxOutlier

public double getMaxOutlier()
Returns the maximum outlier.

Returns:
double The maximum outlier.

getOutliers

public java.util.List getOutliers()
Returns the outliers.

Returns:
List The outliers.

calculateQ3Value

public double calculateQ3Value(java.util.List values)
Calculates the third quartile for a list of numbers in ascending order. If the items in the list are not in ascending order, the result is unspecified. If the list contains items that are null, not an instance of Number, or equivalent to Double.NaN, the result is unspecified.

Parameters:
values - List The values (null permitted).
Returns:
double The third quartile value.

getLabelText

public java.lang.String getLabelText()
Returns the label text.

Specified by:
getLabelText in interface IChartData
Overrides:
getLabelText in class AbstractChartData
Returns:
String The label text (maybe null).

getAreaFunctionArguments

public java.lang.String getAreaFunctionArguments()
Returns the function arguments of hotspot area.

Specified by:
getAreaFunctionArguments in interface IChartData
Overrides:
getAreaFunctionArguments in class AbstractChartData
Returns:
String The function arguments (maybe null).

getAreaURLFragment

public java.lang.String getAreaURLFragment()
Returns the url for hotspot area.

Specified by:
getAreaURLFragment in interface IChartData
Overrides:
getAreaURLFragment in class AbstractChartData
Returns:
String The url fragment (maybe null).

compareTo

public int compareTo(java.lang.Object o)
Implements the compareTo() method of interface Comparable.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - Object The Object to be compared.
Returns:
int A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

equals

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

Overrides:
equals in class AbstractChartData
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 AbstractChartData
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 AbstractChartData
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 string representation of the object.

Overrides:
toString in class AbstractChartData
Returns:
a string representation of the object.