Package ucar.nc2.grid
Class CoordInterval
- java.lang.Object
-
- ucar.nc2.grid.CoordInterval
-
public abstract class CoordInterval extends Object
A Coordinate represented by an interval [start, end). The interval can be positive or negetive.
-
-
Constructor Summary
Constructors Constructor Description CoordInterval()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CoordInterval
create(double start, double end)
Create an interval.abstract double
end()
The ending value of the coordinate intervalboolean
fuzzyEquals(CoordInterval other, double tol)
Compare two intervals to within the given tolerence.double
midpoint()
The midpoint between start and end.static CoordInterval
parse(String source)
The inverse of toString(), or null if cant parse.abstract double
start()
The starting value of the coordinate intervalString
toString()
String
toString(int ndecimals)
Show the interval with given decimal precision.
-
-
-
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
-
-