public Number getNumericValue ( int index ) { if ( ( index < 0 ) || ( index >= nelems ) ) return null ; // LOOK can attributes be enum valued? for now, no switch ( dataType ) { case STRING : try { return new Double ( getStringValue ( index ) ) ; } catch ( NumberFormatException e ) { return null ; } case BYTE : case UBYTE : return values . getByte ( index ) ; case SHORT : case USHORT : return values . getShort ( index ) ; case INT : case UINT : return values . getInt ( index ) ; case FLOAT : return values . getFloat ( index ) ; case DOUBLE : return values . getDouble ( index ) ; case LONG : case ULONG : return values . getLong ( index ) ; } return null ; }
Retrieve a numeric value by index . If it s a String it will try to parse it as a double .