isIntegerInRange returns true if string s is an integer
within the range of integer arguments a and b, inclusive.
358414
public static boolean isIntegerInRange(String s, int a, int b) {
        if (isEmpty(s)) return defaultEmptyOK;
        // Catch non-integer strings to avoid creating a NaN below,
        // which isn't available on JavaScript 1.0 for Windows.
        if (!isSignedInteger(s)) return false;
        // Now, explicitly change the type to integer via parseInt
        // so that the comparison code below will work both on
        // JavaScript 1.2(which typechecks in equality comparisons)
        // and JavaScript 1.1 and before(which doesn't).
        int num = Integer.parseInt(s);

        return ((num >= a) && (num <= b));
    }
666473
public static boolean isRange(String value) {
        if (value == null) {
            return false;
        }
        try {
            Set<Integer> values = parseRange(value);
            return values.size() > 0;
        } catch (Exception e) {
            return false;
        }
    }
84129
func isInteger(s string) bool {

	l := len(s)

	if l == 0 {
		return false
	}

	i := 0

	for ; i < l; i++ {
		if !IsSpaceChar(s[i]) {
			break
		}
	}

	if s[i] == '-' {
		i++
	}

	n := 0
	for ; i < l; i++ {
		if !IsDigit(rune(s[i])) {
			break
		}
		n++
	}

	if n == 0 {
		return false
	}

	for ; i < l; i++ {
		if !IsSpaceChar(s[i]) {
			return false
		}
	}

	return true
}
1254815
def _in_range_inclusive(cls, val, **kwargs):
        '''
        
        '''
        minimum = kwargs.get('min', 0)
        maximum = kwargs.get('max', 1)
        zero_value = kwargs.get('zero_value', 0)

        if isinstance(val, six.string_types):
            if val.lower() == 'not defined':
                return True
            else:
                try:
                    val = int(val)
                except ValueError:
                    return False
        if val is not None:
            if minimum <= val <= maximum or val == zero_value:
                return True
            else:
                return False
        else:
            return False
637734
private boolean isInt(String str) {
        try {
            Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }
1315526
public static boolean isInteger(String _str, boolean _allowNegative) {
        if (_str == null) {
            return false;
        }

        String regex = "[0-9]+$";
        if (_allowNegative) {
            regex = "^-?" + regex;
        } else {
            regex = "^" + regex;
        }
        return _str.matches(regex);
    }
1327749
def value_is_int(self):
        """"""
        try:
            a = float(self.value)
            b = int(a)
        except ValueError:
            return False
        else:
            return a == b
1001682
public static FormValidation validateIntegerInRange(String value, int lower, int upper) {
        try {
            int intValue = Integer.parseInt(value);
            if (intValue < lower) {
                return error(hudson.model.Messages.Hudson_MustBeAtLeast(lower));
            }
            if (intValue > upper) {
                return error(hudson.model.Messages.Hudson_MustBeAtMost(upper));
            }
            return ok();
        } catch (NumberFormatException e) {
            return error(hudson.model.Messages.Hudson_NotANumber());
        }
    }
1241279
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, basestring)
1068055
public static boolean isLetterAndNumber(String string) {
        boolean result = isNotEmpty(string);
        int idx = 0;
        int len = string.length();
        while (result) {
            if (idx >= len) {
                break;
            }
            char c = string.charAt(idx);
            result = isLetter(c) || isNumber(c);
            idx++;
        }
        return result;
    }
1333241
def check_positive_integer(name, value):
    
    try:
        value = int(value)
        is_positive = (value > 0)
    except ValueError:
        raise ValueError('%s should be an integer; got %r' % (name, value))

    if is_positive:
        return value
    else:
        raise ValueError('%s should be positive; got %r' % (name, value))
137185
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static boolean isInRange(@Nonnull final Number number, @Nonnull final BigDecimal min, @Nonnull final BigDecimal max) {
		Check.notNull(number, "number");
		Check.notNull(min, "min");
		Check.notNull(max, "max");

		BigDecimal bigDecimal = null;
		if (number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long) {
			bigDecimal = new BigDecimal(number.longValue());
		} else if (number instanceof Float || number instanceof Double) {
			bigDecimal = new BigDecimal(number.doubleValue());
		} else if (number instanceof BigInteger) {
			bigDecimal = new BigDecimal((BigInteger) number);
		} else if (number instanceof BigDecimal) {
			bigDecimal = (BigDecimal) number;
		} else {
			throw new IllegalNumberArgumentException("Return value is no known subclass of 'java.lang.Number': "
					+ number.getClass().getName());
		}
		return max.compareTo(bigDecimal) >= 0 && min.compareTo(bigDecimal) <= 0;
	}
1276064
private boolean isWithinRange(T value) {
        if (getMinInclusive() != null
                && compareTo(getMinInclusive(), value) > 0) {
            return false;
        }
        if (getMaxInclusive() != null
                && compareTo(getMaxInclusive(), value) < 0) {
            return false;
        }
        return true;
    }
582023
def validate_non_negative_int_or_basestring(option, value):
    
    if isinstance(value, integer_types):
        return value
    elif isinstance(value, string_type):
        try:
            val = int(value)
        except ValueError:
            return value
        return validate_non_negative_integer(option, val)
    raise TypeError("Wrong type for %s, value must be an "
                    "non negative integer or a string" % (option,))
145517
def validate_positive_integer(option, value):
    
    val = validate_integer(option, value)
    if val <= 0:
        raise ValueError("The value of %s must be "
                         "a positive integer" % (option,))
    return val
1231810
function isIntegerBuffer(buf) {
  var sign = '-'.charCodeAt(0)
    , i;

  // empty string is not an integer
  if(!buf.length) return false;

  for(i = 0;i < buf.length;i++) {
    if(!i && buf[i] === sign) continue;
    if(!~NUMBERS.indexOf(buf[i])) return false;
  }

  return true;
}
319602
public static boolean isInteger(String string)
  {
    if(string == null || string.isEmpty()) return false;
    int startIndex = string.charAt(0) == '-' ? 1 : string.charAt(0) == '+' ? 1 : 0;
    for(int i = startIndex, l = string.length(); i < l; i++) {
      if(string.charAt(i) == GROUPING_SEPARATOR) continue;
      if(!Character.isDigit(string.charAt(i))) {
        return false;
      }
    }
    return true;
  }