Package org.goplanit.service.routed
Class RoutedTripsImpl<T extends RoutedTrip>
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<T>
-
- org.goplanit.service.routed.RoutedTripsImpl<T>
-
- All Implemented Interfaces:
Iterable<T>,ManagedIdEntities<T>,RoutedTrips<T>,LongMapWrapper<T>,MapWrapper<Long,T>
- Direct Known Subclasses:
RoutedTripsFrequencyImpl,RoutedTripsScheduleImpl
public abstract class RoutedTripsImpl<T extends RoutedTrip> extends ManagedIdEntitiesImpl<T> implements RoutedTrips<T>
Base class for toued trips of some derived type (either schedule or frequency based for example).- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected RoutedTripFactoryImpl<T>factoryfactory for this container class-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRoutedTripsImpl(RoutedTripsImpl<T> routedTripsBase, boolean deepCopy, BiConsumer<T,T> mapper)Copy constructor, incomplete, requires derived class to explicitly set factoryprotectedRoutedTripsImpl(IdGroupingToken tokenId)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract RoutedTripsImpldeepClone()Deep clone implementationabstract RoutedTripsImpldeepCloneWithMapping(BiConsumer<T,T> mapper)Deep clone implementation where the mapping for its internal copies is captured by the provided mapperRoutedTripFactoryImpl<T>getFactory()Factory to create instance of managed id entity (for this container class)protected voidsetFactory(RoutedTripFactoryImpl<T> factory)The factory to use.abstract RoutedTripsImplshallowClone()Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created-
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, toString, 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.RoutedTrips
determineUsedServiceNodes
-
-
-
-
Field Detail
-
factory
protected RoutedTripFactoryImpl<T extends RoutedTrip> factory
factory for this container class
-
-
Constructor Detail
-
RoutedTripsImpl
protected RoutedTripsImpl(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId- to use
-
RoutedTripsImpl
protected RoutedTripsImpl(RoutedTripsImpl<T> routedTripsBase, boolean deepCopy, BiConsumer<T,T> mapper)
Copy constructor, incomplete, requires derived class to explicitly set factory- Parameters:
routedTripsBase- 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
-
setFactory
protected void setFactory(RoutedTripFactoryImpl<T> factory)
The factory to use. To be set once by super class immediately after construction of the instance- Parameters:
factory- to use
-
getFactory
public RoutedTripFactoryImpl<T> getFactory()
Factory to create instance of managed id entity (for this container class)- Specified by:
getFactoryin interfaceManagedIdEntities<T extends RoutedTrip>- Specified by:
getFactoryin interfaceRoutedTrips<T extends RoutedTrip>- Returns:
- entity factory
-
shallowClone
public abstract RoutedTripsImpl 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<T extends RoutedTrip>- Specified by:
shallowClonein interfaceMapWrapper<Long,T extends RoutedTrip>- Specified by:
shallowClonein interfaceRoutedTrips<T extends RoutedTrip>- Specified by:
shallowClonein classManagedIdEntitiesImpl<T extends RoutedTrip>- Returns:
- copy
-
deepClone
public abstract RoutedTripsImpl deepClone()
Deep clone implementation- Specified by:
deepClonein interfaceManagedIdEntities<T extends RoutedTrip>- Specified by:
deepClonein interfaceRoutedTrips<T extends RoutedTrip>- Specified by:
deepClonein classManagedIdEntitiesImpl<T extends RoutedTrip>- Returns:
- deep copy of entities
-
deepCloneWithMapping
public abstract RoutedTripsImpl deepCloneWithMapping(BiConsumer<T,T> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMappingin interfaceManagedIdEntities<T extends RoutedTrip>- Specified by:
deepCloneWithMappingin interfaceRoutedTrips<T extends RoutedTrip>- Specified by:
deepCloneWithMappingin classManagedIdEntitiesImpl<T extends RoutedTrip>- Parameters:
mapper- to apply to each mapping between original and copy- Returns:
- copy
-
-