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