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 MacroscopicLinksImpldeepClone()Deep clone implementationMacroscopicLinksImpldeepCloneWithMapping(BiConsumer<MacroscopicLink,MacroscopicLink> mapper)Deep clone implementation where the mapping for its internal copies is captured by the provided mapperMacroscopicLinkFactorygetFactory()Factory to create instance of graph entity (for this container class)booleanhasLink(long id)verify if link is presentMacroscopicLinksImplshallowClone()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:
getFactoryin interfaceGraphEntities<MacroscopicLink>- Specified by:
getFactoryin interfaceLinks<MacroscopicLink>- Specified by:
getFactoryin interfaceMacroscopicLinks- Specified by:
getFactoryin interfaceManagedIdEntities<MacroscopicLink>- Overrides:
getFactoryin 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:
shallowClonein interfaceGraphEntities<MacroscopicLink>- Specified by:
shallowClonein interfaceLinks<MacroscopicLink>- Specified by:
shallowClonein interfaceMacroscopicLinks- Specified by:
shallowClonein interfaceManagedGraphEntities<MacroscopicLink>- Specified by:
shallowClonein interfaceManagedIdEntities<MacroscopicLink>- Specified by:
shallowClonein interfaceMapWrapper<Long,MacroscopicLink>- Overrides:
shallowClonein classLinksImpl<MacroscopicLink>- Returns:
- copy
-
deepClone
public MacroscopicLinksImpl deepClone()
Deep clone implementation- Specified by:
deepClonein interfaceGraphEntities<MacroscopicLink>- Specified by:
deepClonein interfaceLinks<MacroscopicLink>- Specified by:
deepClonein interfaceMacroscopicLinks- Specified by:
deepClonein interfaceManagedGraphEntities<MacroscopicLink>- Specified by:
deepClonein interfaceManagedIdEntities<MacroscopicLink>- Overrides:
deepClonein 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:
deepCloneWithMappingin interfaceGraphEntities<MacroscopicLink>- Specified by:
deepCloneWithMappingin interfaceLinks<MacroscopicLink>- Specified by:
deepCloneWithMappingin interfaceMacroscopicLinks- Specified by:
deepCloneWithMappingin interfaceManagedGraphEntities<MacroscopicLink>- Specified by:
deepCloneWithMappingin interfaceManagedIdEntities<MacroscopicLink>- Overrides:
deepCloneWithMappingin 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:
hasLinkin interfaceLinks<MacroscopicLink>- Specified by:
hasLinkin interfaceMacroscopicLinks- Parameters:
id- to check- Returns:
- true when present false otherwise
-
-