1 package net.sourceforge.pmd.properties; 2 3 4 10 public class IntegerProperty extends AbstractScalarProperty { 11 12 19 public IntegerProperty(String theName, String theDescription, int theDefault, float theUIOrder) { 20 super(theName, theDescription, new Integer (theDefault), theUIOrder); 21 } 22 23 31 public IntegerProperty(String theName, String theDescription, int[] theDefaults, float theUIOrder, int maxCount) { 32 this(theName, theDescription, asIntegers(theDefaults), theUIOrder, maxCount); 33 } 34 35 43 public IntegerProperty(String theName, String theDescription, Integer [] theDefaults, float theUIOrder, int maxCount) { 44 super(theName, theDescription, theDefaults, theUIOrder); 45 46 maxValueCount(maxCount); 47 } 48 49 54 private static final Integer [] asIntegers(int[] ints) { 55 Integer [] integers = new Integer [ints.length]; 56 for (int i=0; i<ints.length; i++) integers[i] = new Integer (ints[i]); 57 return integers; 58 } 59 60 65 public Class type() { 66 return Integer .class; 67 } 68 69 74 protected Object createFrom(String value) { 75 return new Integer (value); 76 } 77 78 83 protected Object [] arrayFor(int size) { 84 return new Integer [size]; 85 } 86 } 87 | Popular Tags |