Class SyncXmlIdToIdBreakEdgeSegmentHandler
- java.lang.Object
-
- org.goplanit.graph.modifier.event.handler.SyncXmlIdToIdBreakEdgeSegmentHandler
-
- All Implemented Interfaces:
EventListener
,EventListener
,DirectedGraphModifierListener
,GraphModifierListener
public class SyncXmlIdToIdBreakEdgeSegmentHandler extends Object implements DirectedGraphModifierListener
Whenever edge segments are broken, their edge segments' xml ids remain the same and are no longer unique. It is likely the user wants to keep the XML ids unique despite using internal ids in the memory model. For example when the network is persisted to disk afterwards in which case the XML ids can be used to map ids. In this situation the XML ids need to remain unique. If it is known that the XML ids are initially synced with the internal ids, then this listener can be used to sync all broken edge segments' xml id to the internal id of these edge seegments ensuring uniqueness after performing a break edge segment action. Class supports BreakEdgeSegmentEvent.EVENT_TYPE to apply its syncing functionality upon notification- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description SyncXmlIdToIdBreakEdgeSegmentHandler()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventType[]
getKnownSupportedEventTypes()
Collect explicitly supported event types that are known.void
onDirectedGraphModificationEvent(DirectedGraphModificationEvent event)
Notify method for directed graph modification eventsvoid
onGraphModificationEvent(GraphModificationEvent event)
Notify method for graph modification events-
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.event.EventListener
hasKnownSupportedEventTypes
-
-
-
-
Method Detail
-
getKnownSupportedEventTypes
public EventType[] getKnownSupportedEventTypes()
Collect explicitly supported event types that are known. When not defined the user has to explicitly provide them upon registering the listener on an event producer, otherwise they can be extracted from here- Specified by:
getKnownSupportedEventTypes
in interfaceEventListener
- Returns:
- the supported event types
-
onGraphModificationEvent
public void onGraphModificationEvent(GraphModificationEvent event)
Notify method for graph modification events- Specified by:
onGraphModificationEvent
in interfaceGraphModifierListener
- Parameters:
event
- representing the graph modification event at hand
-
onDirectedGraphModificationEvent
public void onDirectedGraphModificationEvent(DirectedGraphModificationEvent event)
Description copied from interface:DirectedGraphModifierListener
Notify method for directed graph modification events- Specified by:
onDirectedGraphModificationEvent
in interfaceDirectedGraphModifierListener
- Parameters:
event
- representing the directed graph modification event at hand
-
-