Class 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.)
    • Constructor Summary

      Constructors 
      Constructor Description
      AggregatedRange()
      Create an empty range
      AggregatedRange​(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 class
      void adjust​(java.lang.Double lower, java.lang.Double upper)
      Not supported in this class
      boolean contains​(java.lang.Double item)
      Returns a boolean to indicate whether the supplied Double lies within this range
      boolean equals​(java.lang.Object o)  
      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
      java.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 range
      double minimum()
      Returns the minimum (numeric) value in the range
      void removePropertyChangeListener​(java.beans.PropertyChangeListener propertyChangeListener)
      Not supported in this class
      double size()
      The size of the range, computed as the difference between the maximum and the minimum
      java.lang.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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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()
        Specified by:
        lower in interface Range<java.lang.Double>
        Returns:
        the lower value of the range
      • upper

        public java.lang.Double upper()
        The upper value of the range; for this class it is the same as maximum()
        Specified by:
        upper in interface Range<java.lang.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<java.lang.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<java.lang.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<java.lang.Double>
        Returns:
        the size of the range (i.e., max - min)
      • contains

        public boolean contains​(java.lang.Double item)
        Returns a boolean to indicate whether the supplied Double lies within this range
        Specified by:
        contains in interface Range<java.lang.Double>
        Returns:
        a boolean to indicate whether the supplied point lies within the range
      • adjust

        public void adjust​(java.lang.Double lower,
                           java.lang.Double upper)
        Not supported in this class
        Specified by:
        adjust in interface Range<java.lang.Double>
        Parameters:
        lower - the new smallest value of the range
        upper - the new largest value of the range
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.beans.PropertyChangeListener propertyChangeListener)
        Not supported in this class
        Specified by:
        addPropertyChangeListener in interface Range<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 interface Range<java.lang.Double>
        Parameters:
        propertyChangeListener - the PropertyChangeListener to remove
      • getPropertyChangeListeners

        public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
        Description copied from interface: Range
        Gets the registered property change listeners.
        Specified by:
        getPropertyChangeListeners in interface Range<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 interface Range<java.lang.Double>
        Returns:
        the registered property change listeners for a property.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object