cast numerics to double efficiently
<p>I have a bunch of numeric values. They can be <code>Short</code>, <code>Integer</code>, <code>Long</code>, <code>Float</code> or <code>Double</code> (and are the output of an external library (snakeYaml) which returns these as type <code>Object</code>)</p>

<p>I'd like to convert these Objects (which are guaranteed to be <code>Numbers</code>) to <code>Double</code> values in my program. (Storage space is not an issue).</p>

<p>The Java compiler obviously throws a <code>ClassCastException</code> when attempting to cast from an object which is actually an <code>Short</code>/<code>Integer</code>/<code>Long</code>/<code>Float</code> to a <code>Double</code>.</p>

<p>Any hints as to the most efficient method to adopt would be gratefully acknowledged.</p>
