Package bdv.util

Class BoundedRange


  • public final class BoundedRange
    extends Object
    A bounded range with minBound <= min <= max <= maxBound.

    BoundedRange is immutable.

    withMin(double), withMinBound(double) etc derive a new BoundedRange with the given min, minBound etc, while maintaining the minBound <= min <= max <= maxBound property. For example, this.withMin(x), will also update max, if x > this.getMax().

    join(other) will derive a new BoundedRange, with min the minimum of this.getMin() and other.getMin() and so on.

    Author:
    Tobias Pietzsch
    • Constructor Detail

      • BoundedRange

        public BoundedRange​(double minBound,
                            double maxBound,
                            double min,
                            double max)
    • Method Detail

      • getMinBound

        public double getMinBound()
      • getMaxBound

        public double getMaxBound()
      • getBounds

        public Bounds getBounds()
      • getMin

        public double getMin()
      • getMax

        public double getMax()
      • withMaxBound

        public BoundedRange withMaxBound​(double newMaxBound)
      • withMinBound

        public BoundedRange withMinBound​(double newMinBound)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object