Package ucar.nc2.grid

Class CoordInterval


  • public abstract class CoordInterval
    extends Object
    A Coordinate represented by an interval [start, end). The interval can be positive or negetive.
    • Constructor Detail

      • CoordInterval

        public CoordInterval()
    • Method Detail

      • start

        public abstract double start()
        The starting value of the coordinate interval
      • end

        public abstract double end()
        The ending value of the coordinate interval
      • create

        public static CoordInterval create​(double start,
                                           double end)
        Create an interval.
      • midpoint

        public double midpoint()
        The midpoint between start and end.
      • fuzzyEquals

        public boolean fuzzyEquals​(CoordInterval other,
                                   double tol)
        Compare two intervals to within the given tolerence.
      • toString

        public String toString​(int ndecimals)
        Show the interval with given decimal precision.
      • parse

        @Nullable
        public static CoordInterval parse​(String source)
        The inverse of toString(), or null if cant parse. startValue + "-" + endValue