Class AggregatedRange

java.lang.Object
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.)
  • Constructor Details

    • 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 Details

    • 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>
      Parameters:
      item -
      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
    • getPropertyChangeListeners

      public PropertyChangeListener[] getPropertyChangeListeners()
      Description copied from interface: Range
      Gets the registered property change listeners.
      Specified by:
      getPropertyChangeListeners in interface Range<Double>
      Returns:
      the registered property change listeners.
    • getPropertyChangeListeners

      public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
      Description copied from interface: Range
      Gets the registered property change listeners for a property.
      Specified by:
      getPropertyChangeListeners in interface Range<Double>
      Returns:
      the registered property change listeners for a property.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object