Package org.goplanit.network.virtual
Class ConnectoidEdgesImpl
- 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<ConnectoidEdge>
-
- org.goplanit.network.virtual.ConnectoidEdgesImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<ConnectoidEdge>
,GraphEntities<ConnectoidEdge>
,ManagedGraphEntities<ConnectoidEdge>
,ManagedIdEntities<ConnectoidEdge>
,ConnectoidEdges
,LongMapWrapper<ConnectoidEdge>
,MapWrapper<Long,ConnectoidEdge>
public class ConnectoidEdgesImpl extends ManagedGraphEntitiesImpl<ConnectoidEdge> implements ConnectoidEdges
Connectoid edge container implementation- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description ConnectoidEdgesImpl(ConnectoidEdgesImpl other, boolean deepCopy, BiConsumer<ConnectoidEdge,ConnectoidEdge> mapper)
Copy constructor, also creates new factory with this as its underlying containerConnectoidEdgesImpl(IdGroupingToken groupId)
ConstructorConnectoidEdgesImpl(IdGroupingToken groupId, ConnectoidEdgeFactory connectoidEdgeFactory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
clear the containerConnectoidEdgesImpl
deepClone()
Deep clone implementationConnectoidEdgesImpl
deepCloneWithMapping(BiConsumer<ConnectoidEdge,ConnectoidEdge> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperConnectoidEdgeFactory
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 indicatedConnectoidEdgesImpl
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
-
ConnectoidEdgesImpl
public ConnectoidEdgesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
ConnectoidEdgesImpl
public ConnectoidEdgesImpl(IdGroupingToken groupId, ConnectoidEdgeFactory connectoidEdgeFactory)
Constructor- Parameters:
groupId
- to use for creating ids for instancesconnectoidEdgeFactory
- the factory to use
-
ConnectoidEdgesImpl
public ConnectoidEdgesImpl(ConnectoidEdgesImpl other, boolean deepCopy, BiConsumer<ConnectoidEdge,ConnectoidEdge> 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
- apply to each mapping from original to copy
-
-
Method Detail
-
getFactory
public ConnectoidEdgeFactory getFactory()
Factory to create instance of graph entity (for this container class)- Specified by:
getFactory
in interfaceConnectoidEdges
- Specified by:
getFactory
in interfaceGraphEntities<ConnectoidEdge>
- Specified by:
getFactory
in interfaceManagedIdEntities<ConnectoidEdge>
- 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<ConnectoidEdge>
- Overrides:
recreateIds
in classManagedIdEntitiesImpl<ConnectoidEdge>
- 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
-
clear
public void clear()
clear the container- Specified by:
clear
in interfaceMapWrapper<Long,ConnectoidEdge>
- Overrides:
clear
in classMapWrapperImpl<Long,ConnectoidEdge>
-
shallowClone
public ConnectoidEdgesImpl 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 interfaceConnectoidEdges
- Specified by:
shallowClone
in interfaceGraphEntities<ConnectoidEdge>
- Specified by:
shallowClone
in interfaceManagedGraphEntities<ConnectoidEdge>
- Specified by:
shallowClone
in interfaceManagedIdEntities<ConnectoidEdge>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,ConnectoidEdge>
- Specified by:
shallowClone
in classManagedGraphEntitiesImpl<ConnectoidEdge>
- Returns:
- copy
-
deepClone
public ConnectoidEdgesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceConnectoidEdges
- Specified by:
deepClone
in interfaceGraphEntities<ConnectoidEdge>
- Specified by:
deepClone
in interfaceManagedGraphEntities<ConnectoidEdge>
- Specified by:
deepClone
in interfaceManagedIdEntities<ConnectoidEdge>
- Specified by:
deepClone
in classManagedGraphEntitiesImpl<ConnectoidEdge>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public ConnectoidEdgesImpl deepCloneWithMapping(BiConsumer<ConnectoidEdge,ConnectoidEdge> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceConnectoidEdges
- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<ConnectoidEdge>
- Specified by:
deepCloneWithMapping
in interfaceManagedGraphEntities<ConnectoidEdge>
- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<ConnectoidEdge>
- Specified by:
deepCloneWithMapping
in classManagedGraphEntitiesImpl<ConnectoidEdge>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-