1 package net.sourceforge.pmd.properties; 2 3 4 9 public class FloatProperty extends AbstractScalarProperty { 10 11 18 public FloatProperty(String theName, String theDescription, float theDefault, float theUIOrder) { 19 super(theName, theDescription, new Float (theDefault), theUIOrder); 20 } 21 22 30 public FloatProperty(String theName, String theDescription, float[] defaultValues, float theUIOrder, int theMaxValues) { 31 this(theName, theDescription, asFloats(defaultValues), theUIOrder, theMaxValues); 32 } 33 34 42 public FloatProperty(String theName, String theDescription, Float [] defaultValues, float theUIOrder, int theMaxValues) { 43 super(theName, theDescription, defaultValues, theUIOrder); 44 45 maxValueCount(theMaxValues); 46 } 47 48 53 public Class type() { 54 return Float .class; 55 } 56 57 62 private static final Float [] asFloats(float[] floats) { 63 Float [] Floats = new Float [floats.length]; 64 for (int i=0; i<floats.length; i++) Floats[i] = new Float (floats[i]); 65 return Floats; 66 } 67 68 73 protected Object createFrom(String value) { 74 return new Float (value); 75 } 76 77 82 protected Object [] arrayFor(int size) { 83 return new Float [size]; 84 } 85 } 86 | Popular Tags |