Here you can find the source of toShort(Number num)
Parameter | Description |
---|---|
num | A Number instance. |
public static Short toShort(Number num)
//package com.java2s; /*//from ww w . j av a 2 s . com * Copyright (c) 2015 NEC Corporation * 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 { /** * Convert the given number into a {@link Short} instance. * * @param num A {@link Number} instance. * @return A {@link Short} instance equivalent to the given number. * {@code null} if {@code num} is {@code null}. */ public static Short toShort(Number num) { return (num == null) ? null : Short.valueOf(num.shortValue()); } }