View Javadoc

1   /*
2    * Trip Tracker, a real-time position tracking system for the Internet.
3    * Copyright (C) 2006  Team Trip Tracker
4    *
5    * This program is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License as published by the
7    * Free Software Foundation; either version 2 of the License, or (at your
8    * option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful, but
11   * WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License along
16   * with this program; if not, write to the Free Software Foundation, Inc.,
17   * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
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  }