- java.lang.Object
-
- java.util.EventObject
-
- org.arakhne.afc.gis.bus.network.BusChangeEvent
-
- All Implemented Interfaces:
Serializable
public class BusChangeEvent extends EventObject
Describes an event in a bus network. The source of the event is always the network.- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:56
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisbus
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BusChangeEvent.BusChangeEventType
Describes the type of event.
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description BusChangeEvent(AbstractBusPrimitive<?> source, BusChangeEvent.BusChangeEventType type, Object subObject, int index, String propertyName, Object oldValue, Object newValue)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BusItineraryHalt
getBusHalt()
Replies the bus halt which is the source of this event.BusHub
getBusHub()
Replies the bus hub.BusItinerary
getBusItinerary()
Replies the bus itinerary which is the source of this event.BusLine
getBusLine()
Replies the bus line.BusNetwork
getBusNetwork()
Replies the bus network.BusPrimitive<?>
getBusPrimitive()
Replies the bus primitive.BusStop
getBusStop()
Replies the bus stop which is the source of this event.Object
getChangedObject()
Replies the changed object.BusChangeEvent.BusChangeEventType
getEventType()
Replies the type of the event.int
getIndex()
Replies if the index of the event-embedded object in its parent/container.Object
getNewPropertyValue()
Replies the new value of the property that has changed.Object
getOldPropertyValue()
Replies the old value of the property that has changed.String
getPropertyName()
Replies the name of the changed property.RoadSegment
getRoadSegment()
Replies the bus itinerary which is the source of this event.String
toString()
-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Constructor Detail
-
BusChangeEvent
public BusChangeEvent(AbstractBusPrimitive<?> source, BusChangeEvent.BusChangeEventType type, Object subObject, int index, String propertyName, Object oldValue, Object newValue)
Constructor.- Parameters:
source
- is the source of the event.type
- is the type of the event.subObject
- is a changed subobject.index
- is the index of the subObject in its parent.propertyName
- is the name of the changed property, ornull
if no property changed.oldValue
- is the old value of the changed property.newValue
- is the new value of the changed property.
-
-
Method Detail
-
getEventType
@Pure public BusChangeEvent.BusChangeEventType getEventType()
Replies the type of the event.- Returns:
- the type of the event, never
null
.
-
getChangedObject
@Pure public Object getChangedObject()
Replies the changed object.- Returns:
- the changed object or
null
.
-
getBusNetwork
@Pure public BusNetwork getBusNetwork()
Replies the bus network.- Returns:
- the bus network or
null
.
-
getBusPrimitive
@Pure public BusPrimitive<?> getBusPrimitive()
Replies the bus primitive.- Returns:
- the bus primitive or
null
.
-
getBusLine
@Pure public BusLine getBusLine()
Replies the bus line.- Returns:
- the bus line or
null
.
-
getBusHub
@Pure public BusHub getBusHub()
Replies the bus hub.- Returns:
- the bus hub or
null
.
-
getBusHalt
@Pure public BusItineraryHalt getBusHalt()
Replies the bus halt which is the source of this event.- Returns:
- the bus halt or
null
.
-
getBusStop
@Pure public BusStop getBusStop()
Replies the bus stop which is the source of this event.- Returns:
- the bus stop or
null
.
-
getBusItinerary
@Pure public BusItinerary getBusItinerary()
Replies the bus itinerary which is the source of this event.- Returns:
- the bus itinerary or
null
.
-
getRoadSegment
@Pure public RoadSegment getRoadSegment()
Replies the bus itinerary which is the source of this event.- Returns:
- the bus itinerary or
null
.
-
toString
@Pure public String toString()
- Overrides:
toString
in classEventObject
-
getIndex
@Pure public int getIndex()
Replies if the index of the event-embedded object in its parent/container.- Returns:
- if the index of the event-embedded object in its parent/container.
-
getPropertyName
@Pure public String getPropertyName()
Replies the name of the changed property.- Returns:
- the property name or
null
if no property has changed.
-
getOldPropertyValue
public Object getOldPropertyValue()
Replies the old value of the property that has changed.- Returns:
- the old value of the property or
null
ifgetPropertyName()
repliesnull
.
-
getNewPropertyValue
@Pure public Object getNewPropertyValue()
Replies the new value of the property that has changed.- Returns:
- the new value of the property or
null
ifgetPropertyName()
repliesnull
.
-
-