Package org.goplanit.network.virtual
Class ConnectoidSegmentsImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<E>
-
- org.goplanit.utils.graph.ManagedGraphEntitiesImpl<ConnectoidSegment>
-
- org.goplanit.network.virtual.ConnectoidSegmentsImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<ConnectoidSegment>
,GraphEntities<ConnectoidSegment>
,ManagedGraphEntities<ConnectoidSegment>
,ManagedIdEntities<ConnectoidSegment>
,ConnectoidSegments
,LongMapWrapper<ConnectoidSegment>
,MapWrapper<Long,ConnectoidSegment>
public class ConnectoidSegmentsImpl extends ManagedGraphEntitiesImpl<ConnectoidSegment> implements ConnectoidSegments
Connectoid segments container implementation- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description ConnectoidSegmentsImpl(ConnectoidSegmentsImpl other, boolean deepCopy, BiConsumer<ConnectoidSegment,ConnectoidSegment> mapper)
Copy constructor, also creates new factory with this as its underlying containerConnectoidSegmentsImpl(IdGroupingToken groupId)
ConstructorConnectoidSegmentsImpl(IdGroupingToken groupId, ConnectoidSegmentFactory connectoidSegmentFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
clear the containerConnectoidSegmentsImpl
deepClone()
Deep clone implementationConnectoidSegmentsImpl
deepCloneWithMapping(BiConsumer<ConnectoidSegment,ConnectoidSegment> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperConnectoidSegmentFactory
getFactory()
Factory to create instance of graph 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 indicatedConnectoidSegmentsImpl
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.graph.ManagedGraphEntitiesImpl
getByXmlId
-
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
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 org.goplanit.utils.graph.GraphEntities
forEachMatchingIdIn, getByExternalId, getByXmlId
-
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, containsValue, firstMatch, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, removeAll, removeIf, size, stream, streamSorted, toCollection, toMap, valuesAsNewSet
-
-
-
-
Constructor Detail
-
ConnectoidSegmentsImpl
public ConnectoidSegmentsImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
ConnectoidSegmentsImpl
public ConnectoidSegmentsImpl(IdGroupingToken groupId, ConnectoidSegmentFactory connectoidSegmentFactory)
Constructor- Parameters:
groupId
- to use for creating ids for instancesconnectoidSegmentFactory
- the factory to use
-
ConnectoidSegmentsImpl
public ConnectoidSegmentsImpl(ConnectoidSegmentsImpl other, boolean deepCopy, BiConsumer<ConnectoidSegment,ConnectoidSegment> 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 apply
-
-
Method Detail
-
getFactory
public ConnectoidSegmentFactory getFactory()
Factory to create instance of graph entity (for this container class)- Specified by:
getFactory
in interfaceConnectoidSegments
- Specified by:
getFactory
in interfaceGraphEntities<ConnectoidSegment>
- Specified by:
getFactory
in interfaceManagedIdEntities<ConnectoidSegment>
- 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<ConnectoidSegment>
- Overrides:
recreateIds
in classManagedIdEntitiesImpl<ConnectoidSegment>
- 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 ConnectoidSegmentsImpl 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 interfaceConnectoidSegments
- Specified by:
shallowClone
in interfaceGraphEntities<ConnectoidSegment>
- Specified by:
shallowClone
in interfaceManagedGraphEntities<ConnectoidSegment>
- Specified by:
shallowClone
in interfaceManagedIdEntities<ConnectoidSegment>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,ConnectoidSegment>
- Specified by:
shallowClone
in classManagedGraphEntitiesImpl<ConnectoidSegment>
- Returns:
- copy
-
deepClone
public ConnectoidSegmentsImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceConnectoidSegments
- Specified by:
deepClone
in interfaceGraphEntities<ConnectoidSegment>
- Specified by:
deepClone
in interfaceManagedGraphEntities<ConnectoidSegment>
- Specified by:
deepClone
in interfaceManagedIdEntities<ConnectoidSegment>
- Specified by:
deepClone
in classManagedGraphEntitiesImpl<ConnectoidSegment>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public ConnectoidSegmentsImpl deepCloneWithMapping(BiConsumer<ConnectoidSegment,ConnectoidSegment> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceConnectoidSegments
- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<ConnectoidSegment>
- Specified by:
deepCloneWithMapping
in interfaceManagedGraphEntities<ConnectoidSegment>
- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<ConnectoidSegment>
- Specified by:
deepCloneWithMapping
in classManagedGraphEntitiesImpl<ConnectoidSegment>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
clear
public void clear()
clear the container- Specified by:
clear
in interfaceMapWrapper<Long,ConnectoidSegment>
- Overrides:
clear
in classMapWrapperImpl<Long,ConnectoidSegment>
-
-