Java Utililty Methods Number Range Check

List of utility methods to do Number Range Check

Description

The list of methods to do Number Range Check are organized into topic(s).

Method

booleaninRange(double lat, double lon)
in Range
if (Double.compare(lat, 90) <= 0 && Double.compare(lat, -90) >= 0 && Double.compare(lon, 180) <= 0
        && Double.compare(lon, -180) >= 0) {
    return true;
return false;
booleaninRange(double query, double min, double max)
in Range
return query >= min && query <= max;
booleaninRange(double value, double lower, double upper)
Check if a value is within a given range
return value >= lower && value < upper;
booleaninRange(double value, double min, double max)
in Range
return (value >= min && value <= max);
booleaninRange(double value, double min, double max)
in Range
return toRange(value, min, max) == value;
BooleaninRange(double value, double target, double range)
in Range
if (value <= target + range) {
    if (value >= target - range) {
        return true;
return false;
booleaninRange(double x, double y, double z, double sx, double sy, double sz, double r)
in Range
return (((x - sx) * (x - sx)) + ((y - sy) * (y - sy)) + ((z - sz) * (z - sz))) <= (r * r);
booleaninRange(E element, E min, E max)
in Range
int toMin = element.compareTo(min);
int toMax = element.compareTo(max);
return toMin == 0 ? true : toMin < 0 ? false : toMax == 0 ? true : toMax > 0 ? false : true;
booleaninRange(final float testNum, final float min, final float max)
Is testNum in range?
boolean in = false;
if (!Float.isNaN(testNum)) {
    in = testNum >= min && testNum <= max;
return in;
booleaninRange(final int id, final int min, final int max)
in Range
if (min > 10000)
    return (id > min && id < max);
return (id < max && id > min);