Skip to content

Commit 8f01bfd

Browse files
committed
google code format on entire project
1 parent a284739 commit 8f01bfd

36 files changed

+6480
-6520
lines changed

src/main/java/de/taimos/gpsd4java/api/DistanceListener.java

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.
1111
* You may obtain a copy of the License at
12-
*
12+
*
1313
* http://www.apache.org/licenses/LICENSE-2.0
14-
*
14+
*
1515
* Unless required by applicable law or agreed to in writing, software
1616
* distributed under the License is distributed on an "AS IS" BASIS,
1717
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,31 +24,32 @@
2424
import de.taimos.gpsd4java.types.TPVObject;
2525

2626
/**
27-
* Derive this class to implement a listener for location updates which reacts to changes greater a given threshold
27+
* Derive this class to implement a listener for location updates which reacts to changes greater a
28+
* given threshold
2829
*
2930
* @author thoeger
3031
*/
3132
public abstract class DistanceListener extends ObjectListener {
32-
33-
private TPVObject lastPosition;
34-
35-
private final double threshold;
36-
37-
/**
38-
* @param threshold the threshold to fire in kilometers
39-
*/
40-
public DistanceListener(final double threshold) {
41-
this.threshold = threshold;
42-
}
43-
44-
@Override
45-
public void handleTPV(final TPVObject tpv) {
46-
if ((this.lastPosition == null) || (GISTool.getDistance(tpv, this.lastPosition) > this.threshold)) {
47-
this.lastPosition = tpv;
48-
this.handleLocation(tpv);
49-
}
50-
}
51-
52-
protected abstract void handleLocation(TPVObject tpv);
53-
33+
34+
private TPVObject lastPosition;
35+
36+
private final double threshold;
37+
38+
/**
39+
* @param threshold the threshold to fire in kilometers
40+
*/
41+
public DistanceListener(final double threshold) {
42+
this.threshold = threshold;
43+
}
44+
45+
@Override
46+
public void handleTPV(final TPVObject tpv) {
47+
if ((this.lastPosition == null)
48+
|| (GISTool.getDistance(tpv, this.lastPosition) > this.threshold)) {
49+
this.lastPosition = tpv;
50+
this.handleLocation(tpv);
51+
}
52+
}
53+
54+
protected abstract void handleLocation(TPVObject tpv);
5455
}

src/main/java/de/taimos/gpsd4java/api/IObjectListener.java

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.
1111
* You may obtain a copy of the License at
12-
*
12+
*
1313
* http://www.apache.org/licenses/LICENSE-2.0
14-
*
14+
*
1515
* Unless required by applicable law or agreed to in writing, software
1616
* distributed under the License is distributed on an "AS IS" BASIS,
1717
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,35 +33,34 @@
3333
* @author thoeger
3434
*/
3535
public interface IObjectListener {
36-
37-
/**
38-
* @param tpv the TPV object
39-
*/
40-
void handleTPV(TPVObject tpv);
41-
42-
/**
43-
* @param sky the SKY object
44-
*/
45-
void handleSKY(SKYObject sky);
46-
47-
/**
48-
* @param att the ATT object
49-
*/
50-
void handleATT(ATTObject att);
51-
52-
/**
53-
* @param subframe the SUBFRAME object
54-
*/
55-
void handleSUBFRAME(SUBFRAMEObject subframe);
56-
57-
/**
58-
* @param devices the devices object
59-
*/
60-
void handleDevices(DevicesObject devices);
61-
62-
/**
63-
* @param device the device object
64-
*/
65-
void handleDevice(DeviceObject device);
66-
36+
37+
/**
38+
* @param tpv the TPV object
39+
*/
40+
void handleTPV(TPVObject tpv);
41+
42+
/**
43+
* @param sky the SKY object
44+
*/
45+
void handleSKY(SKYObject sky);
46+
47+
/**
48+
* @param att the ATT object
49+
*/
50+
void handleATT(ATTObject att);
51+
52+
/**
53+
* @param subframe the SUBFRAME object
54+
*/
55+
void handleSUBFRAME(SUBFRAMEObject subframe);
56+
57+
/**
58+
* @param devices the devices object
59+
*/
60+
void handleDevices(DevicesObject devices);
61+
62+
/**
63+
* @param device the device object
64+
*/
65+
void handleDevice(DeviceObject device);
6766
}

src/main/java/de/taimos/gpsd4java/api/ObjectListener.java

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* Licensed under the Apache License, Version 2.0 (the "License");
1010
* you may not use this file except in compliance with the License.
1111
* You may obtain a copy of the License at
12-
*
12+
*
1313
* http://www.apache.org/licenses/LICENSE-2.0
14-
*
14+
*
1515
* Unless required by applicable law or agreed to in writing, software
1616
* distributed under the License is distributed on an "AS IS" BASIS,
1717
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,35 +33,34 @@
3333
* @author thoeger
3434
*/
3535
public class ObjectListener implements IObjectListener {
36-
37-
@Override
38-
public void handleTPV(final TPVObject tpv) {
39-
// implement in subclass if needed
40-
}
41-
42-
@Override
43-
public void handleSKY(final SKYObject sky) {
44-
// implement in subclass if needed
45-
}
46-
47-
@Override
48-
public void handleATT(final ATTObject att) {
49-
// implement in subclass if needed
50-
}
51-
52-
@Override
53-
public void handleSUBFRAME(final SUBFRAMEObject subframe) {
54-
// implement in subclass if needed
55-
}
56-
57-
@Override
58-
public void handleDevices(final DevicesObject devices) {
59-
// implement in subclass if needed
60-
}
61-
62-
@Override
63-
public void handleDevice(final DeviceObject device) {
64-
// implement in subclass if needed
65-
}
66-
36+
37+
@Override
38+
public void handleTPV(final TPVObject tpv) {
39+
// implement in subclass if needed
40+
}
41+
42+
@Override
43+
public void handleSKY(final SKYObject sky) {
44+
// implement in subclass if needed
45+
}
46+
47+
@Override
48+
public void handleATT(final ATTObject att) {
49+
// implement in subclass if needed
50+
}
51+
52+
@Override
53+
public void handleSUBFRAME(final SUBFRAMEObject subframe) {
54+
// implement in subclass if needed
55+
}
56+
57+
@Override
58+
public void handleDevices(final DevicesObject devices) {
59+
// implement in subclass if needed
60+
}
61+
62+
@Override
63+
public void handleDevice(final DeviceObject device) {
64+
// implement in subclass if needed
65+
}
6766
}

0 commit comments

Comments
 (0)