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 RelativeLegTimingaddRelativeLegSegmentTiming(ServiceLegSegment parentLegSegment, LocalTime duration, LocalTime dwellTime)Add a new leg's timing to the end of the already registered leg timings.voidclearRelativeLegTimings()Clear all leg timings from the tripRoutedTripScheduleImplclone()Create a shallow copy of this entityLocalTimegetDefaultDwellTime()Get defaultRoutedTripDeparturesgetDepartures()Access to the departures of this scheduleRelativeLegTiminggetRelativeLegTiming(int index)Collect a leg timing based on its indexintgetRelativeLegTimingsSize()Collect the number of registered leg timingslongrecreateManagedIds(IdGroupingToken tokenId)recreate the internal id(s) and set them including the Idable idvoidresetChildManagedIdEntities()Each class that has a managed id, should be able to reset any children that themselves are managedIdEntity containers.voidsetDefaultDwellTime(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:
recreateManagedIdsin interfaceManagedId- Overrides:
recreateManagedIdsin 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:
resetChildManagedIdEntitiesin interfaceManagedId
-
clone
public RoutedTripScheduleImpl clone()
Create a shallow copy of this entity- Specified by:
clonein interfaceIdAble- Specified by:
clonein classRoutedTripImpl- Returns:
- shallow copy of entity
-
getDepartures
public RoutedTripDepartures getDepartures()
Access to the departures of this schedule- Specified by:
getDeparturesin interfaceRoutedTripSchedule- Returns:
- departures
-
clearRelativeLegTimings
public void clearRelativeLegTimings()
Clear all leg timings from the trip- Specified by:
clearRelativeLegTimingsin 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:
addRelativeLegSegmentTimingin 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:
getRelativeLegTimingin interfaceRoutedTripSchedule- Parameters:
index- to collect- Returns:
- the relative leg timing found
-
getRelativeLegTimingsSize
public int getRelativeLegTimingsSize()
Collect the number of registered leg timings- Specified by:
getRelativeLegTimingsSizein 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
-
-