Package org.goplanit.service.routed
Class RoutedTripDeparturesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<RoutedTripDeparture>
-
- org.goplanit.service.routed.RoutedTripDeparturesImpl
-
- All Implemented Interfaces:
Iterable<RoutedTripDeparture>,ManagedIdEntities<RoutedTripDeparture>,RoutedTripDepartures,LongMapWrapper<RoutedTripDeparture>,MapWrapper<Long,RoutedTripDeparture>
public class RoutedTripDeparturesImpl extends ManagedIdEntitiesImpl<RoutedTripDeparture> implements RoutedTripDepartures
Class that manages all routed trip departures for a given routed trip schedule- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Modifier Constructor Description RoutedTripDeparturesImpl(RoutedTripDeparturesImpl other, boolean deepCopy, BiConsumer<RoutedTripDeparture,RoutedTripDeparture> mapper)Copy constructor, also creates new factory with this as its underlying containerprotectedRoutedTripDeparturesImpl(IdGroupingToken tokenId)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallDepartEarlierBy(LocalTime departureTimeIncrease)Make all departures of the routed trip departure depart later by the given amountvoidallDepartLaterBy(LocalTime departureTimeIncrease)Make all departures of the routed trip departure depart later by the given amountRoutedTripDeparturesImpldeepClone()Deep clone implementationRoutedTripDeparturesImpldeepCloneWithMapping(BiConsumer<RoutedTripDeparture,RoutedTripDeparture> mapper)Deep clone implementation where the mapping for its internal copies is captured by the provided mapperRoutedTripDepartureFactoryImplgetFactory()Factory to create instance of managed id entity (for this container class)RoutedTripDeparturesImplshallowClone()Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdStringtoString()String representation of departures-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
getManagedIdClass, recreateIds, reset, updateIdMapping
-
Methods inherited from class org.goplanit.utils.wrapper.LongMapWrapperImpl
containsKey, get, remove
-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
clear, containsValue, createEmptyInstance, firstMatch, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, removeIf, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.LongMapWrapper
get, remove
-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntities
containsKey, getManagedIdClass, groupBy, recreateIds, recreateIds, reset, streamSortedBy
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, containsValue, firstMatch, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, removeAll, removeIf, size, stream, streamSorted, toCollection, toMap, valuesAsNewSet
-
Methods inherited from interface org.goplanit.utils.service.routed.RoutedTripDepartures
streamAscDepartureTime
-
-
-
-
Constructor Detail
-
RoutedTripDeparturesImpl
protected RoutedTripDeparturesImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId- to use
-
RoutedTripDeparturesImpl
public RoutedTripDeparturesImpl(RoutedTripDeparturesImpl other, boolean deepCopy, BiConsumer<RoutedTripDeparture,RoutedTripDeparture> mapper)
Copy constructor, also creates new factory with this as its underlying container- Parameters:
other- to copydeepCopy- when true, create a deep copy, shallow copy otherwisemapper- to use for tracking mapping between original and copied entity (may be null)
-
-
Method Detail
-
getFactory
public RoutedTripDepartureFactoryImpl getFactory()
Factory to create instance of managed id entity (for this container class)- Specified by:
getFactoryin interfaceManagedIdEntities<RoutedTripDeparture>- Specified by:
getFactoryin interfaceRoutedTripDepartures- Returns:
- entity factory
-
allDepartLaterBy
public void allDepartLaterBy(LocalTime departureTimeIncrease)
Make all departures of the routed trip departure depart later by the given amount- Specified by:
allDepartLaterByin interfaceRoutedTripDepartures- Parameters:
departureTimeIncrease- to apply
-
allDepartEarlierBy
public void allDepartEarlierBy(LocalTime departureTimeIncrease)
Make all departures of the routed trip departure depart later by the given amount- Specified by:
allDepartEarlierByin interfaceRoutedTripDepartures- Parameters:
departureTimeIncrease- to apply
-
shallowClone
public RoutedTripDeparturesImpl shallowClone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created- Specified by:
shallowClonein interfaceManagedIdEntities<RoutedTripDeparture>- Specified by:
shallowClonein interfaceMapWrapper<Long,RoutedTripDeparture>- Specified by:
shallowClonein interfaceRoutedTripDepartures- Specified by:
shallowClonein classManagedIdEntitiesImpl<RoutedTripDeparture>- Returns:
- copy
-
deepClone
public RoutedTripDeparturesImpl deepClone()
Deep clone implementation- Specified by:
deepClonein interfaceManagedIdEntities<RoutedTripDeparture>- Specified by:
deepClonein interfaceRoutedTripDepartures- Specified by:
deepClonein classManagedIdEntitiesImpl<RoutedTripDeparture>- Returns:
- deep copy of entities
-
deepCloneWithMapping
public RoutedTripDeparturesImpl deepCloneWithMapping(BiConsumer<RoutedTripDeparture,RoutedTripDeparture> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMappingin interfaceManagedIdEntities<RoutedTripDeparture>- Specified by:
deepCloneWithMappingin classManagedIdEntitiesImpl<RoutedTripDeparture>- Parameters:
mapper- to apply to each mapping between original and copy- Returns:
- copy
-
-