hw7
Class TransitBusEvent
java.lang.Object
|
+--java.util.EventObject
|
+--hw7.TransitBusEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class TransitBusEvent
- extends java.util.EventObject
This class implements a simple event that is fired whenever
a new TransitBus position record is received.
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
TransitBusEvent(java.lang.Object src,
java.lang.String tv,
int vin,
double lat,
double lon,
int route)
Create a new TransitBusEvent. |
Method Summary |
double |
getLat()
Get the latitude value |
double |
getLon()
Get the longitude value |
int |
getRoute()
Get the current route number |
java.lang.String |
getTimeValue()
Get the time value string. |
int |
getVIN()
Get the vehicle identification number. |
java.lang.String |
toString()
return a String describing this event |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TransitBusEvent
public TransitBusEvent(java.lang.Object src,
java.lang.String tv,
int vin,
double lat,
double lon,
int route)
- Create a new TransitBusEvent.
- Parameters:
src
- the object creating this eventtv
- the time value String associated with this updatevin
- the Vehicle ID number for this buslat
- the latitude for this buslon
- the longitude for this busroute
- the route number for this bus
getTimeValue
public java.lang.String getTimeValue()
- Get the time value string.
- Returns:
- the time value string.
getVIN
public int getVIN()
- Get the vehicle identification number.
- Returns:
- the vehicle id number
getLat
public double getLat()
- Get the latitude value
- Returns:
- the latitude
getLon
public double getLon()
- Get the longitude value
- Returns:
- the longitude
getRoute
public int getRoute()
- Get the current route number
- Returns:
- the route number
toString
public java.lang.String toString()
- return a String describing this event
- Overrides:
toString
in class java.util.EventObject
- Returns:
- a descriptive String