Java Number Min Value minIndex(int ix1, int ix2)

Here you can find the source of minIndex(int ix1, int ix2)

Description

Internal method that returns the min between ix1 and ix2 if ix2 is not equal to -1.

License

Open Source License

Parameter

Parameter Description
ix1 The first index
ix2 The second index to compare with ix1

Return

ix2 if (ix2 < ix1 and ix2!=-1) else ix1

Declaration

private static int minIndex(int ix1, int ix2) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  ww  w.ja  v a2s .co m
     * Internal method that returns the min between ix1 and ix2 if ix2 is not
     * equal to -1.
     * 
     * @param ix1 The first index
     * @param ix2 The second index to compare with ix1
     * @return ix2 if (ix2 < ix1 and ix2!=-1) else ix1
     */
    private static int minIndex(int ix1, int ix2) {
        if (ix2 == -1) {
            return ix1;
        }
        if (ix1 <= ix2) {
            return ix1;
        }
        return ix2;
    }
}

Related

  1. minimum(Integer one, Integer two)
  2. minimum(long a, long b, long c)
  3. minimumEditDistance(String target, String source)
  4. minIndent(int a, int b)
  5. minIndex(int a, int b)
  6. minIndexOfOneOf(String string, int start, String needles)
  7. minInt(double d)
  8. minInt(final Iterable numbers)
  9. minInt(float a, float b)