DoubleMultiProperty.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.rule.properties;
05 
06 
07 /**
08  * Defines a property type that supports multiple double-type property values within an upper and lower boundary.
09  * 
10  * @author Brian Remedios
11  */
12 public class DoubleMultiProperty extends AbstractMultiNumericProperty<Double[]> {
13   /**
14    * Constructor for DoubleProperty.
15    * @param theName String
16    * @param theDescription String
17    * @param min Double
18    * @param max Double
19    * @param defaultValues Double[]
20    * @param theUIOrder float
21    */
22   public DoubleMultiProperty(String theName, String theDescription, Double min, Double max, Double[] defaultValues, float theUIOrder) {
23     super(theName, theDescription, min, max, defaultValues, theUIOrder);
24   }
25   
26   /**
27    * @return Class
28    * @see net.sourceforge.pmd.PropertyDescriptor#type()
29    */
30   public Class<Double[]> type() {
31     return Double[].class;
32   }
33 
34   /**
35    * @param value String
36    * @return Object
37    */
38   protected Object createFrom(String value) {
39     return Double.valueOf(value);
40   }
41 
42   /**
43    * @param size int
44    * @return Object[]
45    */
46   protected Object[] arrayFor(int size) {
47     return new Double[size];
48   }
49 }