Package org.goplanit.service.routed
Class RoutedTripScheduleImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.service.routed.RoutedTripImpl
-
- org.goplanit.service.routed.RoutedTripScheduleImpl
-
- All Implemented Interfaces:
Cloneable
,Comparable<IdAble>
,RoutedTrip
,RoutedTripSchedule
,ExternalIdAble
,IdAble
,ManagedId
public class RoutedTripScheduleImpl extends RoutedTripImpl implements RoutedTripSchedule
Implementation of a RoutedTripSchedule interface.- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.goplanit.service.routed.RoutedTrip
ROUTED_TRIP_ID_CLASS
-
-
Constructor Summary
Constructors Constructor Description RoutedTripScheduleImpl(RoutedTripScheduleImpl routedTripScheduleImpl)
Copy constructorRoutedTripScheduleImpl(IdGroupingToken tokenId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelativeLegTiming
addRelativeLegSegmentTiming(ServiceLegSegment parentLegSegment, LocalTime duration, LocalTime dwellTime)
Add a new leg's timing to the end of the already registered leg timings.void
clearRelativeLegTimings()
Clear all leg timings from the tripRoutedTripScheduleImpl
clone()
Create a shallow copy of this entityLocalTime
getDefaultDwellTime()
Get defaultRoutedTripDepartures
getDepartures()
Access to the departures of this scheduleRelativeLegTiming
getRelativeLegTiming(int index)
Collect a leg timing based on its indexint
getRelativeLegTimingsSize()
Collect the number of registered leg timingslong
recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable idvoid
resetChildManagedIdEntities()
Each class that has a managed id, should be able to reset any children that themselves are managedIdEntity containers.void
setDefaultDwellTime(LocalTime defaultDwellTime)
Set default-
Methods inherited from class org.goplanit.service.routed.RoutedTripImpl
generateId
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.service.routed.RoutedTrip
getIdClass
-
-
-
-
Constructor Detail
-
RoutedTripScheduleImpl
public RoutedTripScheduleImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId
- to use for id generation
-
RoutedTripScheduleImpl
public RoutedTripScheduleImpl(RoutedTripScheduleImpl routedTripScheduleImpl)
Copy constructor- Parameters:
routedTripScheduleImpl
- to copy
-
-
Method Detail
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIds
in interfaceManagedId
- Overrides:
recreateManagedIds
in classRoutedTripImpl
- Parameters:
tokenId
- to use- Returns:
- the updated internal id
-
resetChildManagedIdEntities
public void resetChildManagedIdEntities()
Each class that has a managed id, should be able to reset any children that themselves are managedIdEntity containers. This ensures that when resetting such a container any child containers are also reset- Specified by:
resetChildManagedIdEntities
in interfaceManagedId
-
clone
public RoutedTripScheduleImpl clone()
Create a shallow copy of this entity- Specified by:
clone
in interfaceIdAble
- Specified by:
clone
in classRoutedTripImpl
- Returns:
- shallow copy of entity
-
getDepartures
public RoutedTripDepartures getDepartures()
Access to the departures of this schedule- Specified by:
getDepartures
in interfaceRoutedTripSchedule
- Returns:
- departures
-
clearRelativeLegTimings
public void clearRelativeLegTimings()
Clear all leg timings from the trip- Specified by:
clearRelativeLegTimings
in interfaceRoutedTripSchedule
-
addRelativeLegSegmentTiming
public RelativeLegTiming addRelativeLegSegmentTiming(ServiceLegSegment parentLegSegment, LocalTime duration, LocalTime dwellTime)
Add a new leg's timing to the end of the already registered leg timings.- Specified by:
addRelativeLegSegmentTiming
in interfaceRoutedTripSchedule
- Parameters:
parentLegSegment
- (directed leg) to add to the trip's routeduration
- duration of the leg segmentdwellTime
- at the destination of the leg segment- Returns:
- the added timing
-
getRelativeLegTiming
public RelativeLegTiming getRelativeLegTiming(int index)
Collect a leg timing based on its index- Specified by:
getRelativeLegTiming
in interfaceRoutedTripSchedule
- Parameters:
index
- to collect- Returns:
- the relative leg timing found
-
getRelativeLegTimingsSize
public int getRelativeLegTimingsSize()
Collect the number of registered leg timings- Specified by:
getRelativeLegTimingsSize
in interfaceRoutedTripSchedule
- Returns:
- number of relative leg timings registered
-
getDefaultDwellTime
public LocalTime getDefaultDwellTime()
Get default- Returns:
- default dwell time
-
setDefaultDwellTime
public void setDefaultDwellTime(LocalTime defaultDwellTime)
Set default- Parameters:
defaultDwellTime
- to use
-
-