JIDE 3.5.15

com.jidesoft.range
Class AggregatedRange

java.lang.Object
  extended by com.jidesoft.range.AggregatedRange
All Implemented Interfaces:
Range<Double>

public class AggregatedRange
extends Object
implements Range<Double>

A range class formed from a collection of Positionable instances. The class can be used to derive the minimum and maximum values for the collection of Positionables, as well as providing other useful information such as the sum of all the positive values and the sum of all the negative values. (These are used in the preparation of a stacked bar chart.)


Field Summary
 
Fields inherited from interface com.jidesoft.range.Range
PROPERTY_MAX, PROPERTY_MIN
 
Constructor Summary
AggregatedRange()
          Create an empty range
AggregatedRange(Collection<Positionable> positions)
          Create a range from the supplied Positionable instances
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
          Not supported in this class
 void adjust(Double lower, Double upper)
          Not supported in this class
 boolean contains(Double item)
          Returns a boolean to indicate whether the supplied Double lies within this range
 int getCount()
          The number of points being combined in this range
 int getNegativeCount()
           
 double getNegativeSum()
          Computes the sum of all the negative Positionables
 int getPositiveCount()
           
 double getPositiveSum()
          Computes the sum of all the positive Positionables
 Double lower()
          The lower value of the range; for this class it is the same as minimum()
 double maximum()
          Returns the maximum (numeric) value in the range
 double minimum()
          Returns the minimum (numeric) value in the range
 void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
          Not supported in this class
 double size()
          The size of the range, computed as the difference between the maximum and the minimum
 Double upper()
          The upper value of the range; for this class it is the same as maximum()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregatedRange

public AggregatedRange()
Create an empty range


AggregatedRange

public AggregatedRange(Collection<Positionable> positions)
Create a range from the supplied Positionable instances

Parameters:
positions - the instances of the Positionable interface
Method Detail

lower

public Double lower()
The lower value of the range; for this class it is the same as minimum()

Specified by:
lower in interface Range<Double>
Returns:
the lower value of the range

upper

public Double upper()
The upper value of the range; for this class it is the same as maximum()

Specified by:
upper in interface Range<Double>
Returns:
the upper value of the range

getCount

public int getCount()
The number of points being combined in this range

Returns:
the number of points contributing to the range

getPositiveSum

public double getPositiveSum()
Computes the sum of all the positive Positionables

Returns:
the sum of all the positive Positionables

getPositiveCount

public int getPositiveCount()

getNegativeSum

public double getNegativeSum()
Computes the sum of all the negative Positionables

Returns:
the sum of all the negative Positionables

getNegativeCount

public int getNegativeCount()

minimum

public double minimum()
Returns the minimum (numeric) value in the range

Specified by:
minimum in interface Range<Double>
Returns:
the minimum value in the range

maximum

public double maximum()
Returns the maximum (numeric) value in the range

Specified by:
maximum in interface Range<Double>
Returns:
the maximum value in the range

size

public double size()
The size of the range, computed as the difference between the maximum and the minimum

Specified by:
size in interface Range<Double>
Returns:
the size of the range (i.e., max - min)

contains

public boolean contains(Double item)
Returns a boolean to indicate whether the supplied Double lies within this range

Specified by:
contains in interface Range<Double>
Returns:
a boolean to indicate whether the supplied point lies within the range

adjust

public void adjust(Double lower,
                   Double upper)
Not supported in this class

Specified by:
adjust in interface Range<Double>
Parameters:
lower - the new smallest value of the range
upper - the new largest value of the range

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Not supported in this class

Specified by:
addPropertyChangeListener in interface Range<Double>
Parameters:
propertyChangeListener - the new property change listener

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Not supported in this class

Specified by:
removePropertyChangeListener in interface Range<Double>
Parameters:
propertyChangeListener - the PropertyChangeListener to remove

JIDE 3.5.15