1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package triptracker.client.net;
21
22 import java.io.IOException;
23 import java.util.List;
24
25 import triptracker.core.ConnectionState;
26 import triptracker.core.Route;
27
28 /***
29 * An abstract adapter class for receiving GPS socket events. The methods in
30 * this class are empty. This class exists as convenience for creating listener
31 * objects.
32 * <p>
33 * Extend this class to create a GPSSocketConnection listener and override the
34 * methods for the events of interest. (If you implement the GPSSocketListener
35 * interface, you have to define all of the methods in it. This abstract class
36 * defines null methods for them all, so you only have to define methods for
37 * events you care about.)
38 * <p>
39 * Create a listener object using the extended class and then register it with a
40 * GPSSocketConnection using the socket's addListener method. When the socket's
41 * status changes, the relevant method in the listener object is invoked.
42 */
43 public class GPSSocketAdapter implements GPSSocketListener {
44
45 /***
46 * {@inheritDoc}
47 */
48 public void routeList(List<Route> routes) { }
49
50 /***
51 * {@inheritDoc}
52 */
53 public void invalidMessage(String message) { }
54
55 /***
56 * {@inheritDoc}
57 */
58 public void socketError(IOException e) { }
59
60 /***
61 * {@inheritDoc}
62 */
63 public void connectionUpdate(ConnectionState state) { }
64
65 /***
66 * {@inheritDoc}
67 */
68 public void routeCreated(int routeId) { }
69
70 }