Class DefinedBoundsAxis

    • Method Detail

      • getCoordinateBounds

        public Extent<Double> getCoordinateBounds​(int index)
        Description copied from interface: ReferenceableAxis
        Gets the coordinate bounds associated with the point at the given index. In some types of ReferenceableAxis, each point along the axis is associated with a range of positions, rather than a single infinitesimal position. This method returns this range.
        Specified by:
        getCoordinateBounds in interface ReferenceableAxis<Double>
        Overrides:
        getCoordinateBounds in class AbstractIrregularAxis<Double>
        Returns:
        the coordinate bounds associated with the point at the given index. Returns an Extent with low=high if the bounds are infinitesimal. Never returns null.
      • getMidpoint

        protected Double getMidpoint​(Double pos1,
                                     Double pos2)
        Description copied from class: AbstractIrregularAxis
        Returns the midpoint of the supplied values. This is so that certain methods can be abstracted without worrying about non-trivial midpoint calculation (e.g. DateTimes)
        Overrides:
        getMidpoint in class ReferenceableAxisImpl
        Parameters:
        pos1 - the first value
        pos2 - the second value
        Returns:
        the midpoint of the values
      • extendFirstValue

        protected Double extendFirstValue​(Double firstVal,
                                          Double nextVal)
        Description copied from class: AbstractReferenceableAxis
        This should return the lower bound of the first value of the axis, based on the first and second values. This will generally be equivalent to:

        firstVal - (nextVal-firstVal)/2

        Overrides:
        extendFirstValue in class ReferenceableAxisImpl
        Parameters:
        firstVal - The first value of the axis
        nextVal - The second value of the axis
        Returns:
        The lower bound of the first axis value
      • extendLastValue

        protected Double extendLastValue​(Double lastVal,
                                         Double secondLastVal)
        Description copied from class: AbstractReferenceableAxis
        This should return the upper bound of the last value of the axis, based on the last two values. This will generally be equivalent to:

        lastVal + (lastVal-secondLastVal)/2

        Overrides:
        extendLastValue in class ReferenceableAxisImpl
        Parameters:
        lastVal - The last value of the axis
        secondLastVal - The next-to-last value of the axis
        Returns:
        The upper bound of the the final axis value