/** * Sets the data of this value. The data must be an array of the type <code>float[]</code> or * <code>String[]</code> and have a length that is equal to the value returned by the * <code>getNumDataElems</code> method. * * @param data the data array * * @throws IllegalArgumentException if data is <code>null</code> or it is not an array of the required type or * does not have the required array length. */ @Override public void setElems(Object data) { Guardian.assertNotNull("data", data); if (data instanceof String[] && ((String[]) data).length == getNumElems()) { final String[] strings = (String[]) data; for (int i = 0; i < getNumElems(); i++) { _array[i] = java.lang.Float.parseFloat(strings[i]); } return; } if (!(data instanceof float[]) || ((float[]) data).length != getNumElems()) { throw new IllegalArgumentException("data is not a float[" + getNumElems() + "]"); } System.arraycopy(data, 0, _array, 0, getNumElems()); }