Here you can find the source of toShort(String numeric)
public static short toShort(String numeric)
//package com.java2s; //License from project: Open Source License public class Main { public static short toShort(String numeric) { return (isNumeric(numeric)) ? Short.parseShort(numeric) : 0; }/*w ww . ja v a 2 s . c om*/ public static boolean isNumeric(String string) { return string.matches("[+-]?[0-9]+"); } }