Java Range rangeInteger(Integer num, Integer min, Integer max)

Here you can find the source of rangeInteger(Integer num, Integer min, Integer max)

Description

range Integer

License

Open Source License

Declaration

public static Integer rangeInteger(Integer num, Integer min, Integer max) 

Method Source Code

//package com.java2s;

public class Main {

    public static Integer rangeInteger(Integer num, Integer min, Integer max) {
        if (num == null) {
            return num;
        }//from   w  w w.java  2 s .co  m
        if (num < min) {
            num = min;
        }
        if (num > max) {
            num = max;
        }
        return num;
    }
}

Related

  1. rangeDivide(Integer begin, Integer end, Integer divideNum)
  2. rangeEquals(byte[] a, int aStart, byte[] b, int bStart, int length)
  3. rangeIncludes(long x, long min, long max)
  4. rangeLimit(float value, float min, float max)
  5. rangeLimit(int receiver, int minBound, int maxBound)
  6. rangeOfByteArray(byte[] data, int offset, int length)
  7. rangeToScale(long rawValue, long rangeMin, long rangeMax, double scaleMin, double scaleMax)