Interface Range<T>

All Known Implementing Classes:
AbstractNumericRange, AbstractRange, AggregatedRange, BigDecimalRange, BooleanRange, CategoryRange, CombinedNumericRange, IntegerRange, LongRange, NumericRange, StringRange, TimeRange

public interface Range<T>
Author:
Simon White (swhite@catalysoft.com)
  • Field Details

    • PROPERTY_MIN

      static final String PROPERTY_MIN
      The name of the minimum property. Used when firing property change events
      See Also:
    • PROPERTY_MAX

      static final String PROPERTY_MAX
      The name of the maximum property. Used when firing property change events
      See Also:
  • Method Details

    • lower

      T lower()
      Returns:
      the smallest value of the range
    • upper

      T upper()
      Returns:
      the largest value of the range
    • adjust

      void adjust(T lower, T upper)
      Adjusts the range.
      Parameters:
      lower - the new smallest value of the range
      upper - the new largest value of the range
    • minimum

      double minimum()
      This may be the numeric representation of lower() or it may be rounded down.
      Returns:
      the numeric value of the smallest value to include in the range.
    • maximum

      double maximum()
      This may be the numeric representation of upper() or it may be rounded up.
      Returns:
      The numeric value of the largest value to include in the range.
    • size

      double size()
      Compute the size of the range
    • contains

      boolean contains(T x)
      Determines whether the supplied point lies within this range. For continuous ranges this is interpreted as a pair of inequalities on the supplied value (i.e., min invalid input: '<'= x invalid input: '<'= max), but for discrete ranges the contains() method is more like a set membership test.
      Parameters:
      x -
      Returns:
      a boolean to indicate whether the supplied point lies within the range
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener listener)
      You can add a property change listener if you are interested to know when the range changes
      Parameters:
      listener - the new property change listener
    • removePropertyChangeListener

      void removePropertyChangeListener(PropertyChangeListener listener)
      Remove a property change listener
      Parameters:
      listener - the PropertyChangeListener to remove
    • getPropertyChangeListeners

      PropertyChangeListener[] getPropertyChangeListeners()
      Gets the registered property change listeners.
      Returns:
      the registered property change listeners.
    • getPropertyChangeListeners

      PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
      Gets the registered property change listeners for a property.
      Returns:
      the registered property change listeners for a property.