Class LinkSegmentsImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<LinkSegment>
-
- org.goplanit.network.layer.physical.LinkSegmentsImpl
-
- All Implemented Interfaces:
Cloneable,Iterable<LinkSegment>,GraphEntities<LinkSegment>,ManagedIdEntities<LinkSegment>,LinkSegments,LongMapWrapper<LinkSegment>,MapWrapper<Long,LinkSegment>
public class LinkSegmentsImpl extends ManagedIdEntitiesImpl<LinkSegment> implements LinkSegments, ManagedIdEntities<LinkSegment>
Link segments primary managed container implementation- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description LinkSegmentsImpl(LinkSegmentsImpl linkSegmentsImpl)Copy constructorLinkSegmentsImpl(IdGroupingToken groupId)ConstructorLinkSegmentsImpl(IdGroupingToken groupId, LinkSegmentFactory linkSegmentFactory)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkSegmentsImplclone()Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdLinkSegmentFactorygetFactory()Factory to create instance of graph entity (for this container class)voidrecreateIds(boolean resetManagedIdClass)Recreate the ids for all registered entities with or without resettingvoidreset()When reset it called, it not only clears the entries, but also resets the managedids, such that when the container is reused the managed ids start from zero again.-
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, contains, createEmptyInstance, findFirst, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
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, recreateIds
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, contains, findFirst, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, size, toCollection, valuesAsNewSet
-
-
-
-
Constructor Detail
-
LinkSegmentsImpl
public LinkSegmentsImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId- to use for creating ids for instances
-
LinkSegmentsImpl
public LinkSegmentsImpl(IdGroupingToken groupId, LinkSegmentFactory linkSegmentFactory)
Constructor- Parameters:
groupId- to use for creating ids for instanceslinkSegmentFactory- the factory to use
-
LinkSegmentsImpl
public LinkSegmentsImpl(LinkSegmentsImpl linkSegmentsImpl)
Copy constructor- Parameters:
linkSegmentsImpl- to copy
-
-
Method Detail
-
getFactory
public LinkSegmentFactory getFactory()
Factory to create instance of graph entity (for this container class)- Specified by:
getFactoryin interfaceGraphEntities<LinkSegment>- Specified by:
getFactoryin interfaceLinkSegments- Specified by:
getFactoryin interfaceManagedIdEntities<LinkSegment>- Returns:
- entity factory
-
recreateIds
public void recreateIds(boolean resetManagedIdClass)
Recreate the ids for all registered entities with or without resetting- Specified by:
recreateIdsin interfaceManagedIdEntities<LinkSegment>- Overrides:
recreateIdsin classManagedIdEntitiesImpl<LinkSegment>- 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
-
clone
public LinkSegmentsImpl clone()
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:
clonein interfaceGraphEntities<LinkSegment>- Specified by:
clonein interfaceLinkSegments- Specified by:
clonein interfaceManagedIdEntities<LinkSegment>- Specified by:
clonein interfaceMapWrapper<Long,LinkSegment>- Specified by:
clonein classManagedIdEntitiesImpl<LinkSegment>- Returns:
- copy
-
reset
public void reset()
When reset it called, it not only clears the entries, but also resets the managedids, such that when the container is reused the managed ids start from zero again. If any entries are managedEntities themselves or contain managed entities themselves, they are reset as well- Specified by:
resetin interfaceManagedIdEntities<LinkSegment>- Overrides:
resetin classManagedIdEntitiesImpl<LinkSegment>
-
-