Java Integer Clamp clampUShortNegative(int in)

Here you can find the source of clampUShortNegative(int in)

Description

clamp U Short Negative

License

Open Source License

Declaration

public static final short clampUShortNegative(int in) 

Method Source Code

//package com.java2s;
/*/*from  w  ww.j  a v a 2s.c o  m*/
 * $RCSfile: ImageUtil.java,v $
 *
 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
 *
 * Use is subject to license terms.
 *
 * $Revision: 1.2 $
 * $Date: 2006/07/21 20:53:28 $
 * $State: Exp $
 */

public class Main {
    public static final short clampUShortNegative(int in) {
        return (in < 0 ? (short) 0 : (short) in);
    }
}

Related

  1. clampString(String string, int limit)
  2. clampTo_0_255(int i)
  3. clampToByte(int c)
  4. clampToByteSize(int value)
  5. clampToShort(int x)
  6. ClampValue(int value, int lowerBound, int upperBound)