Package org.goplanit.utils.id
Class ManagedIdEntityFactoryImpl<E extends ManagedId>
- java.lang.Object
-
- org.goplanit.utils.id.ManagedIdEntityFactoryImpl<E>
-
- Type Parameters:
E- type of managed id entity
- All Implemented Interfaces:
ManagedIdEntityFactory<E>
- Direct Known Subclasses:
CentroidFactoryImpl,DirectedConnectoidFactoryImpl,DirectedPathFactoryImpl,GraphEntityFactoryImpl,MacroscopicLinkSegmentTypeFactoryImpl,MacroscopicNetworkLayerFactoryImpl,ModeFactoryImpl,RoutedServiceFactory,RoutedServicesLayerFactory,RoutedTripDepartureFactory,RoutedTripFactory,ServiceNetworkLayerFactoryImpl,TransferZoneGroupFactoryImpl,UndirectedConnectoidFactoryImpl,ZoneFactoryImpl
public abstract class ManagedIdEntityFactoryImpl<E extends ManagedId> extends Object implements ManagedIdEntityFactory<E>
Base implementation for creating and registering managed id entities and conducting changes to ids based on the factory settings for generating ids.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected IdGroupingTokengroupIdTokenthe id group token
-
Constructor Summary
Constructors Modifier Constructor Description protectedManagedIdEntityFactoryImpl(IdGroupingToken groupIdToken)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EcreateUniqueCopyOf(ManagedId entityToCopy)Create a shallow copy of the passed in entity, albeit with unique internal ids.IdGroupingTokengetIdGroupingToken()Collect the id grouping token used by this factoryvoidsetIdGroupingToken(IdGroupingToken groupIdToken)Each factory needs a token to allow all underlying factory methods to generated ids uniquely tied to the group token the entities belong to
-
-
-
Field Detail
-
groupIdToken
protected IdGroupingToken groupIdToken
the id group token
-
-
Constructor Detail
-
ManagedIdEntityFactoryImpl
protected ManagedIdEntityFactoryImpl(IdGroupingToken groupIdToken)
Constructor- Parameters:
groupIdToken- to use for creating element ids
-
-
Method Detail
-
setIdGroupingToken
public void setIdGroupingToken(IdGroupingToken groupIdToken)
Each factory needs a token to allow all underlying factory methods to generated ids uniquely tied to the group token the entities belong to- Specified by:
setIdGroupingTokenin interfaceManagedIdEntityFactory<E extends ManagedId>- Parameters:
groupIdToken- , contiguous id generation within this group of entity instances created with the factory methods
-
getIdGroupingToken
public IdGroupingToken getIdGroupingToken()
Collect the id grouping token used by this factory- Specified by:
getIdGroupingTokenin interfaceManagedIdEntityFactory<E extends ManagedId>- Returns:
- idGroupingToken the id grouping token used by this builder
-
createUniqueCopyOf
public E createUniqueCopyOf(ManagedId entityToCopy)
Create a shallow copy of the passed in entity, albeit with unique internal ids. Not registered on the container.- Specified by:
createUniqueCopyOfin interfaceManagedIdEntityFactory<E extends ManagedId>- Parameters:
entityToCopy- the entity to copy- Returns:
- new entity based on passed in entity
-
-