Java Utililty Methods Number Min Value

List of utility methods to do Number Min Value

Description

The list of methods to do Number Min Value are organized into topic(s).

Method

intminimumEditDistance(String target, String source)
Computes the minimum edit distance between two strings.
int n = target.length();
int m = source.length();
int distance[][] = new int[n + 1][m + 1];
for (int i = 0; i <= n; ++i) {
    distance[i][0] = i;
for (int j = 0; j <= m; ++j) {
    distance[0][j] = j;
...
intminIndent(int a, int b)
Determine the 'known minimum' of two indentation levels.
if (a == -1) {
    return b;
} else if (b == -1) {
    return a;
} else {
    return Math.min(a, b);
intminIndex(int a, int b)
Returns the minimum index >= 0, if any

Use to find the first of two characters in a string:
minIndex(s.indexOf('/'), indexOf('\'))

return (a < 0) ? b : (b < 0) ? a : (a < b) ? a : b;
intminIndex(int ix1, int ix2)
Internal method that returns the min between ix1 and ix2 if ix2 is not equal to -1.
if (ix2 == -1) {
    return ix1;
if (ix1 <= ix2) {
    return ix1;
return ix2;
intminIndexOfOneOf(String string, int start, String needles)
Find the first occurrence of any character in needles in string from the position start on.
if (string == null || string.length() == 0) {
    return -1;
int len = string.length();
while (start < len) {
    if (needles.indexOf(string.charAt(start)) >= 0) {
        return start;
    ++start;
return -1;
intminInt(double d)
min Int
return (int) Math.floor(d);
intminInt(final Iterable numbers)
min Int
int max = Integer.MAX_VALUE;
for (final Integer number : numbers) {
    final int value = number.intValue();
    if (value < max) {
        max = value;
return max;
...
intminInt(float a, float b)
Minimum value rounded down.
return floor(min(a, b));
intminInt(int a, int b)
finds smaller of 2 valid int's based on COFH's minI method
return a < b ? a : b;
intminInteger(int var1, int var2)
min Integer
return var1 < var2 ? var1 : var2;