evicebeans.7.131.2.source-code.FloatArrayEditor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of devicebeans Show documentation
Show all versions of devicebeans Show documentation
MDSplus device beans for jdevice dialogs
import java.beans.*;
public class FloatArrayEditor extends PropertyEditorSupport
{
@Override
public String getJavaInitializationString()
{
final float[] array = (float[]) getValue();
if (array == null)
return "null";
final StringBuffer sb = new StringBuffer("new float[] {");
for (int i = 0; i < array.length; i++)
{
sb.append("(float)" + (new Float(array[i])).toString());
if (i < (array.length - 1))
sb.append(",");
}
sb.append("}");
return sb.toString();
}
}