aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MegastekProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-07 14:25:47 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-07 14:25:47 +1300
commite7bc5f93cd05f27f41bfb25836a04feb511adc17 (patch)
treefdd2f79116c0403c6bd1fad061b07463379cdc03 /src/org/traccar/protocol/MegastekProtocolDecoder.java
parent2260e9543dc586300b005c97ca83b2902c414968 (diff)
downloadtrackermap-server-e7bc5f93cd05f27f41bfb25836a04feb511adc17.tar.gz
trackermap-server-e7bc5f93cd05f27f41bfb25836a04feb511adc17.tar.bz2
trackermap-server-e7bc5f93cd05f27f41bfb25836a04feb511adc17.zip
Replace more valueOf with parseXxx
Diffstat (limited to 'src/org/traccar/protocol/MegastekProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MegastekProtocolDecoder.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java
index c07ce38ff..c7ca41dfb 100644
--- a/src/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -85,9 +85,9 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
// Time
Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
time.clear();
- time.set(Calendar.HOUR_OF_DAY, Integer.valueOf(parser.group(index++)));
- time.set(Calendar.MINUTE, Integer.valueOf(parser.group(index++)));
- time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++)));
+ time.set(Calendar.HOUR_OF_DAY, Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.MINUTE, Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.SECOND, Integer.parseInt(parser.group(index++)));
// Validity
position.setValid(parser.group(index++).compareTo("A") == 0);
@@ -117,9 +117,9 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
}
// Date
- time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++)));
- time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1);
- time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++)));
+ time.set(Calendar.DAY_OF_MONTH, Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.MONTH, Integer.parseInt(parser.group(index++)) - 1);
+ time.set(Calendar.YEAR, 2000 + Integer.parseInt(parser.group(index++)));
position.setTime(time.getTime());
return true;
@@ -207,7 +207,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
String charger = parser.group(index++);
if (charger != null) {
- position.set(Event.KEY_CHARGE, Integer.valueOf(charger) == 1);
+ position.set(Event.KEY_CHARGE, Integer.parseInt(charger) == 1);
}
position.set(Event.KEY_MCC, parser.group(index++));
@@ -313,12 +313,12 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
time.clear();
- time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++)));
- time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1);
- time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++)));
- time.set(Calendar.HOUR_OF_DAY, Integer.valueOf(parser.group(index++)));
- time.set(Calendar.MINUTE, Integer.valueOf(parser.group(index++)));
- time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++)));
+ time.set(Calendar.DAY_OF_MONTH, Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.MONTH, Integer.parseInt(parser.group(index++)) - 1);
+ time.set(Calendar.YEAR, 2000 + Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.HOUR_OF_DAY, Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.MINUTE, Integer.parseInt(parser.group(index++)));
+ time.set(Calendar.SECOND, Integer.parseInt(parser.group(index++)));
position.setTime(time.getTime());
position.setValid(parser.group(index++).equals("A"));