Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 85 |  | Methods: | 7
| NCLOC: | 27 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
FloatProperty.java | 100% | 100% | 100% | 100% |

1 |  | package net.sourceforge.pmd.properties;
2 |  |
3 |  |
4 |  | /**
5 |  | * Defines a property type that support float property values.
6 |  | *
7 |  | * @author Brian Remedios
8 |  | */
9 |  | public class FloatProperty extends AbstractScalarProperty {
10 |  |
11 |  | /**
12 |  | * Constructor for FloatProperty.
13 |  | * @param theName String
14 |  | * @param theDescription String
15 |  | * @param theDefault float
16 |  | * @param theUIOrder float
17 |  | */
18 | 4 | public FloatProperty(String theName, String theDescription, float theDefault, float theUIOrder) {
19 | 4 | super(theName, theDescription, new Float(theDefault), theUIOrder);
20 |  | }
21 |  |
22 |  | /**
23 |  | * Constructor for FloatProperty.
24 |  | * @param theName String
25 |  | * @param theDescription String
26 |  | * @param defaultValues boolean[]
27 |  | * @param theUIOrder float
28 |  | * @param theMaxValues int
29 |  | */
30 | 3 | public FloatProperty(String theName, String theDescription, float[] defaultValues, float theUIOrder, int theMaxValues) {
31 | 3 | this(theName, theDescription, asFloats(defaultValues), theUIOrder, theMaxValues);
32 |  | }
33 |  |
34 |  | /**
35 |  | * Constructor for FloatProperty.
36 |  | * @param theName String
37 |  | * @param theDescription String
38 |  | * @param defaultValues Float[]
39 |  | * @param theUIOrder float
40 |  | * @param theMaxValues int
41 |  | */
42 | 3 | public FloatProperty(String theName, String theDescription, Float[] defaultValues, float theUIOrder, int theMaxValues) {
43 | 3 | super(theName, theDescription, defaultValues, theUIOrder);
44 |  |
45 | 3 | maxValueCount(theMaxValues);
46 |  | }
47 |  |
48 |  | /**
49 |  | * Method type.
50 |  | * @return Class
51 |  | * @see net.sourceforge.pmd.PropertyDescriptor#type()
52 |  | */
53 | 3 | public Class type() {
54 | 3 | return Float.class;
55 |  | }
56 |  |
57 |  | /**
58 |  | * Method asFloats.
59 |  | * @param floats float[]
60 |  | * @return Float[]
61 |  | */
62 | 3 | private static final Float[] asFloats(float[] floats) {
63 | 3 | Float[] Floats = new Float[floats.length];
64 | 11 | for (int i=0; i<floats.length; i++) Floats[i] = new Float(floats[i]);
65 | 3 | return Floats;
66 |  | }
67 |  |
68 |  | /**
69 |  | * Method createFrom.
70 |  | * @param value String
71 |  | * @return Object
72 |  | */
73 | 11 | protected Object createFrom(String value) {
74 | 11 | return new Float(value);
75 |  | }
76 |  |
77 |  | /**
78 |  | * Method arrayFor.
79 |  | * @param size int
80 |  | * @return Object[]
81 |  | */
82 | 1 | protected Object[] arrayFor(int size) {
83 | 1 | return new Float[size];
84 |  | }
85 |  | }