Class MacroscopicLinksImpl
- 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<L>
-
- org.goplanit.network.layer.physical.LinksImpl<MacroscopicLink>
-
- org.goplanit.network.layer.macroscopic.MacroscopicLinksImpl
-
- All Implemented Interfaces:
Cloneable
,Iterable<MacroscopicLink>
,GraphEntities<MacroscopicLink>
,ManagedGraphEntities<MacroscopicLink>
,ManagedIdEntities<MacroscopicLink>
,MacroscopicLinks
,Links<MacroscopicLink>
,LongMapWrapper<MacroscopicLink>
,MapWrapper<Long,MacroscopicLink>
public class MacroscopicLinksImpl extends LinksImpl<MacroscopicLink> implements MacroscopicLinks
Macroscopic links primary managed container implementation- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.network.layer.physical.LinksImpl
linkFactory
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description MacroscopicLinksImpl(MacroscopicLinksImpl other, boolean deepCopy, BiConsumer<MacroscopicLink,MacroscopicLink> mapper)
Copy constructor, also creates a new factory with reference to this containerMacroscopicLinksImpl(IdGroupingToken groupId)
ConstructorMacroscopicLinksImpl(IdGroupingToken groupId, MacroscopicLinkFactory factory)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MacroscopicLinksImpl
deepClone()
Deep clone implementationMacroscopicLinksImpl
deepCloneWithMapping(BiConsumer<MacroscopicLink,MacroscopicLink> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperMacroscopicLinkFactory
getFactory()
Factory to create instance of graph entity (for this container class)boolean
hasLink(long id)
verify if link is presentMacroscopicLinksImpl
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.network.layer.physical.LinksImpl
recreateIds, reset
-
Methods inherited from class org.goplanit.utils.graph.ManagedGraphEntitiesImpl
getByXmlId
-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
getManagedIdClass, 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 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, 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
-
-
-
-
Constructor Detail
-
MacroscopicLinksImpl
public MacroscopicLinksImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for creating ids for instances
-
MacroscopicLinksImpl
public MacroscopicLinksImpl(IdGroupingToken groupId, MacroscopicLinkFactory factory)
Constructor- Parameters:
groupId
- to use for creating ids for instancesfactory
- the factory to use
-
MacroscopicLinksImpl
public MacroscopicLinksImpl(MacroscopicLinksImpl other, boolean deepCopy, BiConsumer<MacroscopicLink,MacroscopicLink> mapper)
Copy constructor, also creates a new factory with reference to this container- Parameters:
other
- to copydeepCopy
- when true, create a deep cpy, shallow copy otherwisemapper
- to apply
-
-
Method Detail
-
getFactory
public MacroscopicLinkFactory getFactory()
Factory to create instance of graph entity (for this container class)- Specified by:
getFactory
in interfaceGraphEntities<MacroscopicLink>
- Specified by:
getFactory
in interfaceLinks<MacroscopicLink>
- Specified by:
getFactory
in interfaceMacroscopicLinks
- Specified by:
getFactory
in interfaceManagedIdEntities<MacroscopicLink>
- Overrides:
getFactory
in classLinksImpl<MacroscopicLink>
- Returns:
- entity factory
-
shallowClone
public MacroscopicLinksImpl 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 interfaceGraphEntities<MacroscopicLink>
- Specified by:
shallowClone
in interfaceLinks<MacroscopicLink>
- Specified by:
shallowClone
in interfaceMacroscopicLinks
- Specified by:
shallowClone
in interfaceManagedGraphEntities<MacroscopicLink>
- Specified by:
shallowClone
in interfaceManagedIdEntities<MacroscopicLink>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,MacroscopicLink>
- Overrides:
shallowClone
in classLinksImpl<MacroscopicLink>
- Returns:
- copy
-
deepClone
public MacroscopicLinksImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceGraphEntities<MacroscopicLink>
- Specified by:
deepClone
in interfaceLinks<MacroscopicLink>
- Specified by:
deepClone
in interfaceMacroscopicLinks
- Specified by:
deepClone
in interfaceManagedGraphEntities<MacroscopicLink>
- Specified by:
deepClone
in interfaceManagedIdEntities<MacroscopicLink>
- Overrides:
deepClone
in classLinksImpl<MacroscopicLink>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public MacroscopicLinksImpl deepCloneWithMapping(BiConsumer<MacroscopicLink,MacroscopicLink> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceGraphEntities<MacroscopicLink>
- Specified by:
deepCloneWithMapping
in interfaceLinks<MacroscopicLink>
- Specified by:
deepCloneWithMapping
in interfaceMacroscopicLinks
- Specified by:
deepCloneWithMapping
in interfaceManagedGraphEntities<MacroscopicLink>
- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<MacroscopicLink>
- Overrides:
deepCloneWithMapping
in classLinksImpl<MacroscopicLink>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
hasLink
public boolean hasLink(long id)
verify if link is present- Specified by:
hasLink
in interfaceLinks<MacroscopicLink>
- Specified by:
hasLink
in interfaceMacroscopicLinks
- Parameters:
id
- to check- Returns:
- true when present false otherwise
-
-