Class AxisRange

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class AxisRange
    extends de.gsi.dataset.spi.DataRange
    Holds the range of the axis along with scale and tick numbers format to be used.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double axisLength  
      protected double scale  
      protected double tickUnit  
      • Fields inherited from class de.gsi.dataset.spi.DataRange

        max, min
    • Constructor Summary

      Constructors 
      Constructor Description
      AxisRange()  
      AxisRange​(double lowerBound, double upperBound, double axisLength, double scale, double tickUnit)  
    • Field Detail

      • axisLength

        protected double axisLength
      • scale

        protected double scale
      • tickUnit

        protected double tickUnit
    • Constructor Detail

      • AxisRange

        public AxisRange()
      • AxisRange

        public AxisRange​(double lowerBound,
                         double upperBound,
                         double axisLength,
                         double scale,
                         double tickUnit)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class de.gsi.dataset.spi.DataRange
      • getLowerBound

        public double getLowerBound()
        Returns:
        the lower bound of the axis
      • getUpperBound

        public double getUpperBound()
        Returns:
        the upper bound of the axis
      • getAxisLength

        public double getAxisLength()
        Returns:
        the axis length in display (ie. pixel) units
      • getScale

        public double getScale()
        Returns:
        the calculated scale
      • getTickUnit

        public double getTickUnit()
      • setAxisLength

        public void setAxisLength​(double length,
                                  Side side)
        Calculate a new scale for this axis. This should not effect any state(properties) of this axis.
        Parameters:
        length - The display length of the axis
        side - axis side
      • add

        public void add​(AxisRange range)
        Add the specified data range to this range.
        Parameters:
        range - range to be added
      • substract

        public AxisRange substract​(AxisRange range)
        Substracts the specified data range from this range. TODO: check algorithm definiton
        Parameters:
        range - range to be subtracted
        Returns:
        this axis with reduced limits
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class de.gsi.dataset.spi.DataRange
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class de.gsi.dataset.spi.DataRange