All Downloads are FREE. Search and download functionalities are using the official Maven repository.

evicebeans.7.131.2.source-code.FloatArrayEditor Maven / Gradle / Ivy

There is a newer version: 7.139.60
Show newest version
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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy