Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1611 | - | 1 | package dongfang.mkt.configuration; |
2 | |||
3 | public class DynamicByteEntry extends StaticByteEntry { |
||
4 | int minValue = 0; |
||
5 | int maxValue = 255; |
||
6 | String staticCodeName; |
||
7 | String dynamicCodeName; |
||
8 | |||
9 | DynamicByteEntry(String name) { |
||
10 | super(name); |
||
11 | } |
||
12 | |||
13 | int getMinValue() { |
||
14 | return minValue; |
||
15 | } |
||
16 | |||
17 | int getMaxValue() { |
||
18 | return maxValue; |
||
19 | } |
||
20 | |||
21 | void setMinValue(int minValue) { |
||
22 | this.minValue = minValue; |
||
23 | } |
||
24 | |||
25 | void setMaxValue(int maxValue) { |
||
26 | this.maxValue = maxValue; |
||
27 | } |
||
28 | |||
29 | String getStaticCodeName() { |
||
30 | return staticCodeName; |
||
31 | } |
||
32 | |||
33 | String getDynamicCodeName() { |
||
34 | return dynamicCodeName; |
||
35 | } |
||
36 | |||
37 | void setStaticCodeName(String staticCodeName) { |
||
38 | this.staticCodeName = staticCodeName; |
||
39 | } |
||
40 | |||
41 | void setDynamicCodeName(String dynamicCodeName) { |
||
42 | this.dynamicCodeName = dynamicCodeName; |
||
43 | } |
||
44 | |||
45 | void toXML(StringBuilder result) { |
||
46 | String s_value; |
||
47 | int numberOfLowestVariable = 256 - ParameterSet.NUMBER_OF_VARIABLES; |
||
48 | if (value >= numberOfLowestVariable) { |
||
49 | s_value = "var" + (value - numberOfLowestVariable); |
||
50 | } else |
||
51 | s_value = Integer.toString(value); |
||
52 | result.append(" <parameter name=\"" + name + "\" value=\"" |
||
53 | + s_value + "\"/>\n"); |
||
54 | } |
||
55 | } |