Java Utililty Methods Object to Short

List of utility methods to do Object to Short

Description

The list of methods to do Object to Short are organized into topic(s).

Method

ShortcastShort(Object o)
cast Short
if (o instanceof Number) {
    return ((Number) o).shortValue();
return null;
ShortcastShort(Object o)
Casts a value to a short.
if (o == null) {
    return null;
if (o instanceof Number) {
    return ((Number) o).shortValue();
try {
    return Short.valueOf(o.toString());
...
shortcastShort(Object val)
cast Short
return (val instanceof String) ? Short.parseShort(val.toString().trim()) : ((Number) val).shortValue();
float[]castShortToFloat(short[] x)
cast Short To Float
float[] res = new float[x.length];
for (int i = 0; i < x.length; i++)
    res[i] = x[i];
return res;
shortcastToShort(final int value)
cast To Short
final short result = (short) value;
if (result != value) {
    throw new ArithmeticException("Out of range: " + value);
return result;
ShortcastToShort(final String uid)
cast To Short
try {
    return Short.decode(uid);
} catch (NumberFormatException nfe) {
    return null;
ShortcastToShort(Object value)
cast To Short
if (value == null) {
    return null;
if (value instanceof Number) {
    return ((Number) value).shortValue();
if (value instanceof String) {
    String strVal = (String) value;
...
ShortcastToShort(Object value)
cast To Short
return (Short) value;