Java Number Min Value minComparable(T first, T second)

Here you can find the source of minComparable(T first, T second)

Description

min Comparable

License

Open Source License

Declaration

public static <T extends Comparable<T>> T minComparable(T first,
            T second) 

Method Source Code

//package com.java2s;
/**//from   w  w  w  .ja va  2 s .  c  o  m
 * Copyright (c) 2010-2017 by the respective copyright holders.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    public static <T extends Comparable<T>> T minComparable(T first,
            T second) {
        return first.compareTo(second) <= 0 ? first : second;
    }
}

Related

  1. min8(double v1, double v2, double v3, double v4, double v5, double v6, double v7, double v8)
  2. MIN_MAX(int min, int mid, int max)
  3. minChar(String input)
  4. minCharsForCriteria(final int length, final int criteria)
  5. minCommonMultiple(int m, int n)
  6. minCoverageEstimate(short mask)
  7. minCurveSegmentLength(String segmentTypeName)
  8. minDark(final int colorValue)
  9. minDeg2Bigger(long number)