Package com.jidesoft.range
Class AggregatedRange
java.lang.Object
com.jidesoft.range.AggregatedRange
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
ConstructorsConstructorDescriptionCreate an empty rangeAggregatedRange
(Collection<Positionable> positions) Create a range from the supplied Positionable instances -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener propertyChangeListener) Not supported in this classvoid
Not supported in this classboolean
Returns a boolean to indicate whether the supplied Double lies within this rangeboolean
int
getCount()
The number of points being combined in this rangeint
double
Computes the sum of all the negative Positionablesint
double
Computes the sum of all the positive PositionablesGets the registered property change listeners.getPropertyChangeListeners
(String propertyName) Gets the registered property change listeners for a property.int
hashCode()
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
(PropertyChangeListener propertyChangeListener) Not supported in this classdouble
size()
The size of the range, computed as the difference between the maximum and the minimumupper()
The upper value of the range; for this class it is the same as maximum()
-
Constructor Details
-
AggregatedRange
public AggregatedRange()Create an empty range -
AggregatedRange
Create a range from the supplied Positionable instances- Parameters:
positions
- the instances of the Positionable interface
-
-
Method Details
-
lower
The lower value of the range; for this class it is the same as minimum() -
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
Returns a boolean to indicate whether the supplied Double lies within this range -
adjust
Not supported in this class -
addPropertyChangeListener
Not supported in this class- Specified by:
addPropertyChangeListener
in interfaceRange<Double>
- Parameters:
propertyChangeListener
- the new property change listener
-
removePropertyChangeListener
Not supported in this class- Specified by:
removePropertyChangeListener
in interfaceRange<Double>
- Parameters:
propertyChangeListener
- thePropertyChangeListener
to remove
-
getPropertyChangeListeners
Description copied from interface:Range
Gets the registered property change listeners.- Specified by:
getPropertyChangeListeners
in interfaceRange<Double>
- Returns:
- the registered property change listeners.
-
getPropertyChangeListeners
Description copied from interface:Range
Gets the registered property change listeners for a property.- Specified by:
getPropertyChangeListeners
in interfaceRange<Double>
- Returns:
- the registered property change listeners for a property.
-
equals
-
hashCode
public int hashCode()
-