Package org.goplanit.zoning
Class TransferZonesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<Z>
-
- org.goplanit.zoning.ZonesImpl<TransferZone>
-
- org.goplanit.zoning.TransferZonesImpl
-
- All Implemented Interfaces:
Iterable<TransferZone>
,ManagedIdEntities<TransferZone>
,LongMapWrapper<TransferZone>
,MapWrapper<Long,TransferZone>
,TransferZones
,Zones<TransferZone>
public class TransferZonesImpl extends ZonesImpl<TransferZone> implements TransferZones
implementation of the Zones <T> interface for transfer zones- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description TransferZonesImpl(IdGroupingToken groupId)
ConstructorTransferZonesImpl(TransferZoneFactory transferZoneFactory)
ConstructorTransferZonesImpl(TransferZonesImpl other, boolean deepCopy, BiConsumer<TransferZone,TransferZone> mapper)
Copy constructor, also creates new factory with this as its underlying container
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransferZonesImpl
deepClone()
Deep clone implementationTransferZonesImpl
deepCloneWithMapping(BiConsumer<TransferZone,TransferZone> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperTransferZoneFactory
getFactory()
Factory to create instance of managed id entity (for this container class)void
recreateIds(boolean resetManagedIdClass)
Recreate the ids for all registered entities with or without resetting, this includes child managed ids, i.e., nested magedidentities containers if so indicatedTransferZonesImpl
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-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
getManagedIdClass, 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, 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.zoning.Zones
getByXmlId, getNumberOfCentroids
-
-
-
-
Constructor Detail
-
TransferZonesImpl
public TransferZonesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
TransferZonesImpl
public TransferZonesImpl(TransferZoneFactory transferZoneFactory)
Constructor- Parameters:
transferZoneFactory
- the factory to use
-
TransferZonesImpl
public TransferZonesImpl(TransferZonesImpl other, boolean deepCopy, BiConsumer<TransferZone,TransferZone> mapper)
Copy constructor, also creates new factory with this as its underlying container- Parameters:
other
- to copydeepCopy
- when true, create a eep copy, shallow copy otherwisemapper
- to use for tracking mapping between original and copied entity (may be null)
-
-
Method Detail
-
getFactory
public TransferZoneFactory getFactory()
Factory to create instance of managed id entity (for this container class)- Specified by:
getFactory
in interfaceManagedIdEntities<TransferZone>
- Specified by:
getFactory
in interfaceTransferZones
- Returns:
- entity factory
-
recreateIds
public void recreateIds(boolean resetManagedIdClass)
Recreate the ids for all registered entities with or without resetting, this includes child managed ids, i.e., nested magedidentities containers if so indicated- Specified by:
recreateIds
in interfaceManagedIdEntities<TransferZone>
- Overrides:
recreateIds
in classManagedIdEntitiesImpl<TransferZone>
- Parameters:
resetManagedIdClass
- when true we reset the managedId's counter to zero (via its id class) before recreating the ids, otherwise we simply recreate the managed id by starting with the next available id without resetting
-
shallowClone
public TransferZonesImpl 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:
shallowClone
in interfaceManagedIdEntities<TransferZone>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,TransferZone>
- Specified by:
shallowClone
in interfaceTransferZones
- Specified by:
shallowClone
in interfaceZones<TransferZone>
- Specified by:
shallowClone
in classZonesImpl<TransferZone>
- Returns:
- copy
-
deepClone
public TransferZonesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceManagedIdEntities<TransferZone>
- Specified by:
deepClone
in interfaceTransferZones
- Specified by:
deepClone
in interfaceZones<TransferZone>
- Specified by:
deepClone
in classZonesImpl<TransferZone>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public TransferZonesImpl deepCloneWithMapping(BiConsumer<TransferZone,TransferZone> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<TransferZone>
- Specified by:
deepCloneWithMapping
in interfaceTransferZones
- Specified by:
deepCloneWithMapping
in interfaceZones<TransferZone>
- Specified by:
deepCloneWithMapping
in classZonesImpl<TransferZone>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-