Package com.jidesoft.range
Class AggregatedRange
- java.lang.Object
-
- com.jidesoft.range.AggregatedRange
-
- All Implemented Interfaces:
Range<java.lang.Double>
public class AggregatedRange extends java.lang.Object implements Range<java.lang.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
Constructors Constructor Description AggregatedRange()
Create an empty rangeAggregatedRange(java.util.Collection<Positionable> positions)
Create a range from the supplied Positionable instances
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Not supported in this classvoid
adjust(java.lang.Double lower, java.lang.Double upper)
Not supported in this classboolean
contains(java.lang.Double item)
Returns a boolean to indicate whether the supplied Double lies within this rangeboolean
equals(java.lang.Object o)
int
getCount()
The number of points being combined in this rangeint
getNegativeCount()
double
getNegativeSum()
Computes the sum of all the negative Positionablesint
getPositiveCount()
double
getPositiveSum()
Computes the sum of all the positive Positionablesjava.beans.PropertyChangeListener[]
getPropertyChangeListeners()
Gets the registered property change listeners.java.beans.PropertyChangeListener[]
getPropertyChangeListeners(java.lang.String propertyName)
Gets the registered property change listeners for a property.int
hashCode()
java.lang.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 rangedouble
minimum()
Returns the minimum (numeric) value in the rangevoid
removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Not supported in this classdouble
size()
The size of the range, computed as the difference between the maximum and the minimumjava.lang.Double
upper()
The upper value of the range; for this class it is the same as maximum()
-
-
-
Constructor Detail
-
AggregatedRange
public AggregatedRange()
Create an empty range
-
AggregatedRange
public AggregatedRange(java.util.Collection<Positionable> positions)
Create a range from the supplied Positionable instances- Parameters:
positions
- the instances of the Positionable interface
-
-
Method Detail
-
lower
public java.lang.Double lower()
The lower value of the range; for this class it is the same as minimum()
-
upper
public java.lang.Double upper()
The upper value of the range; for this class it is the same as maximum()
-
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
-
maximum
public double maximum()
Returns the maximum (numeric) value in the range
-
size
public double size()
The size of the range, computed as the difference between the maximum and the minimum
-
contains
public boolean contains(java.lang.Double item)
Returns a boolean to indicate whether the supplied Double lies within this range
-
adjust
public void adjust(java.lang.Double lower, java.lang.Double upper)
Not supported in this class
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Not supported in this class- Specified by:
addPropertyChangeListener
in interfaceRange<java.lang.Double>
- Parameters:
propertyChangeListener
- the new property change listener
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Not supported in this class- Specified by:
removePropertyChangeListener
in interfaceRange<java.lang.Double>
- Parameters:
propertyChangeListener
- thePropertyChangeListener
to remove
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Description copied from interface:Range
Gets the registered property change listeners.- Specified by:
getPropertyChangeListeners
in interfaceRange<java.lang.Double>
- Returns:
- the registered property change listeners.
-
getPropertyChangeListeners
public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String propertyName)
Description copied from interface:Range
Gets the registered property change listeners for a property.- Specified by:
getPropertyChangeListeners
in interfaceRange<java.lang.Double>
- Returns:
- the registered property change listeners for a property.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-