1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.ws.params.simple; |
22 |
|
|
23 |
|
import jalview.ws.params.ParameterI; |
24 |
|
import jalview.ws.params.ValueConstrainI; |
25 |
|
|
26 |
|
|
27 |
|
@author |
28 |
|
|
29 |
|
|
|
|
| 0% |
Uncovered Elements: 32 (32) |
Complexity: 10 |
Complexity Density: 0.5 |
|
30 |
|
public class IntegerParameter extends Option implements ParameterI |
31 |
|
{ |
32 |
|
int defval; |
33 |
|
|
34 |
|
int min, max; |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
36 |
0 |
public ValueConstrainI getValidValue()... |
37 |
|
{ |
38 |
0 |
return new ValueConstrainI() |
39 |
|
{ |
40 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
0 |
@Override... |
42 |
|
public ValueType getType() |
43 |
|
{ |
44 |
0 |
return ValueType.Integer; |
45 |
|
} |
46 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
47 |
0 |
@Override... |
48 |
|
public Number getMin() |
49 |
|
{ |
50 |
0 |
if (min < max) |
51 |
|
{ |
52 |
0 |
return min; |
53 |
|
} |
54 |
|
else |
55 |
|
{ |
56 |
0 |
return null; |
57 |
|
} |
58 |
|
} |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
60 |
0 |
@Override... |
61 |
|
public Number getMax() |
62 |
|
{ |
63 |
0 |
if (min < max) |
64 |
|
{ |
65 |
0 |
return max; |
66 |
|
} |
67 |
|
else |
68 |
|
{ |
69 |
0 |
return null; |
70 |
|
} |
71 |
|
} |
72 |
|
}; |
73 |
|
} |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
75 |
0 |
public IntegerParameter(IntegerParameter parm)... |
76 |
|
{ |
77 |
0 |
super(parm); |
78 |
0 |
max = parm.max; |
79 |
0 |
min = parm.min; |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
82 |
0 |
public IntegerParameter(String name, String description, boolean required,... |
83 |
|
int defValue, int min, int max) |
84 |
|
{ |
85 |
0 |
super(name, description, required, String.valueOf(defValue), null, null, |
86 |
|
null); |
87 |
0 |
defval = defValue; |
88 |
0 |
this.min = min; |
89 |
0 |
this.max = max; |
90 |
|
} |
91 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
92 |
0 |
public IntegerParameter(String name, String description, boolean required,... |
93 |
|
int defValue, int value, int min, int max) |
94 |
|
{ |
95 |
0 |
super(name, description, required, String.valueOf(defValue), |
96 |
|
String.valueOf(value), null, null); |
97 |
0 |
defval = defValue; |
98 |
0 |
this.min = min; |
99 |
0 |
this.max = max; |
100 |
|
} |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0 |
@Override... |
103 |
|
public IntegerParameter copy() |
104 |
|
{ |
105 |
0 |
return new IntegerParameter(this); |
106 |
|
} |
107 |
|
|
108 |
|
} |