Class ZoningModifierImpl
- java.lang.Object
-
- org.goplanit.utils.event.EventProducerImpl
-
- org.goplanit.zoning.modifier.ZoningModifierImpl
-
- All Implemented Interfaces:
EventProducer
,ZoningModifierEventProducer
,ZoningModifier
public class ZoningModifierImpl extends EventProducerImpl implements ZoningModifier
Implementation of the zoningModifier interface- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Zoning
zoning
The zoning instance to apply modifications on-
Fields inherited from class org.goplanit.utils.event.EventProducerImpl
listeners
-
-
Constructor Summary
Constructors Constructor Description ZoningModifierImpl(Zoning zoning)
constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(ZoningModifierListener listener)
Register listener for all its supported event types fired by a zoning modifiervoid
addListener(ZoningModifierListener listener, ZoningModifierEventType eventType)
Register listeners for events fired by a zoning modifierprotected void
fireEvent(EventListener eventListener, Event event)
Let derived class deal with the handling of the listener, where based on the derived event implementation the listener's concrete class can be determined which in turn allows for calling the right event callback method which is unknown at this base level since this event mechanism does not force a particular notification method signature on its listener interfacevoid
recreateConnectoidIds()
recreate all internal ids of all connectoids both od and transfer connectoidsvoid
recreateManagedIdEntities()
Recreate all managed id entities owned by this zoningprotected void
recreateOdZoneIds(boolean resetIds)
recreate part of zone ids (od zones)void
recreateTransferZoneGroupIds()
recreate all internal ids for all zones both od and transfer zonesprotected void
recreateTransferZoneIds(boolean resetIds)
recreate part of zone ids (transfer zones)void
recreateZoneIds()
recreate all internal ids fo all zones both od and transfer zonesvoid
removeDanglingOdZones(boolean recreateZoneIds)
a Method that scans the od zones and removes any that are not associated with any connectoids, i.e., are not connected to any physical network layer and therefore are considered dangling.void
removeDanglingTransferZoneGroups()
a Method that scans the transfer zone groups and removes any groups that are empty, i.e., have no transfer zones and are therefore considered dangling.void
removeDanglingTransferZones(boolean recreateZoneIds)
a Method that scans the transfer zones and removes any transfer zones that are not associated with any directed connectoids, i.e., are not connected to any physical network layer and therefore are considered dangling.void
removeDanglingZones()
a Method that scans the zones and removes any zones that are not associated with any connectoids, i.e., are not connected to any physical network layer and therefore are considered dangling.void
removeListener(ZoningModifierListener listener)
Remove listener for all event types it is registered forvoid
removeListener(ZoningModifierListener listener, ZoningModifierEventType eventType)
Remove listener for given event typevoid
removeUnusedTransferConnectoids(ServiceNetworkLayers serviceNetworkLayers, boolean recreateManagedConnectoidIds)
Remove all directed connectoids for which no service nodes' physical nodes on any of the given layers match its access nodes, i.e., the directed connectoid has no routed services that visit it, and therefore they are not explicitly, but implicitly dangling and are removedprotected void
removeZone(Zone toRemove)
remove a zone from its container class (if applicable) without doing anything else-
Methods inherited from class org.goplanit.utils.event.EventProducerImpl
addListener, addListener, addListener, addListener, fireEvent, getEventTypesWithListeners, hasListener, hasListeners, numberOfListeners, removeAllListeners, removeListener, removeListener
-
-
-
-
Field Detail
-
zoning
protected final Zoning zoning
The zoning instance to apply modifications on
-
-
Constructor Detail
-
ZoningModifierImpl
public ZoningModifierImpl(Zoning zoning)
constructor- Parameters:
zoning
- instance to apply modifications on
-
-
Method Detail
-
fireEvent
protected void fireEvent(EventListener eventListener, Event event)
Let derived class deal with the handling of the listener, where based on the derived event implementation the listener's concrete class can be determined which in turn allows for calling the right event callback method which is unknown at this base level since this event mechanism does not force a particular notification method signature on its listener interface- Specified by:
fireEvent
in classEventProducerImpl
- Parameters:
eventListener
- to notify for the eventevent
- to process for the listener
-
removeZone
protected void removeZone(Zone toRemove)
remove a zone from its container class (if applicable) without doing anything else- Parameters:
toRemove
- zone to be removed
-
recreateOdZoneIds
protected void recreateOdZoneIds(boolean resetIds)
recreate part of zone ids (od zones)- Parameters:
resetIds
- flag indicating whether to reset the ids before creating new ones
-
recreateTransferZoneIds
protected void recreateTransferZoneIds(boolean resetIds)
recreate part of zone ids (transfer zones)- Parameters:
resetIds
- flag indicating whether to reset the ids before creating new ones
-
recreateConnectoidIds
public void recreateConnectoidIds()
recreate all internal ids of all connectoids both od and transfer connectoidsfire #RecreatedZoningEntitiesManagedIdsEvent upon completion with those connectoids
- Specified by:
recreateConnectoidIds
in interfaceZoningModifier
-
recreateZoneIds
public void recreateZoneIds()
recreate all internal ids fo all zones both od and transfer zonesfires #ModifiedZoneIdsEvent after completion
- Specified by:
recreateZoneIds
in interfaceZoningModifier
-
recreateTransferZoneGroupIds
public void recreateTransferZoneGroupIds()
recreate all internal ids for all zones both od and transfer zonesfire #RecreatedZoningEntitiesManagedIdsEvent upon completion with those transfer zone groups
- Specified by:
recreateTransferZoneGroupIds
in interfaceZoningModifier
-
removeDanglingTransferZones
public void removeDanglingTransferZones(boolean recreateZoneIds)
a Method that scans the transfer zones and removes any transfer zones that are not associated with any directed connectoids, i.e., are not connected to any physical network layer and therefore are considered dangling. If a transfer zone is removed and this zone belongs to a transfer zone group, it is also removed from this groupfires two #RecreatedZoningEntitiesManagedIdsEvent upon completion for transfer zones
- Specified by:
removeDanglingTransferZones
in interfaceZoningModifier
- Parameters:
recreateZoneIds
- when true recreate all zone ids, false do not
-
removeDanglingOdZones
public void removeDanglingOdZones(boolean recreateZoneIds)
a Method that scans the od zones and removes any that are not associated with any connectoids, i.e., are not connected to any physical network layer and therefore are considered dangling.fires two #RecreatedZoningEntitiesManagedIdsEvent upon completion for od zones
- Specified by:
removeDanglingOdZones
in interfaceZoningModifier
- Parameters:
recreateZoneIds
- when true recreate all zone ids, false do not
-
removeDanglingZones
public void removeDanglingZones()
a Method that scans the zones and removes any zones that are not associated with any connectoids, i.e., are not connected to any physical network layer and therefore are considered dangling. If a transfer zone is removed and this zone belongs to a transfer zone group, it is also removed from this groupfires two #RecreatedZoningEntitiesManagedIdsEvent upon completion one for od and one for transfer zones
- Specified by:
removeDanglingZones
in interfaceZoningModifier
-
removeDanglingTransferZoneGroups
public void removeDanglingTransferZoneGroups()
a Method that scans the transfer zone groups and removes any groups that are empty, i.e., have no transfer zones and are therefore considered dangling.fire #RecreatedZoningEntitiesManagedIdsEvent upon completion with those transfer zone groups
- Specified by:
removeDanglingTransferZoneGroups
in interfaceZoningModifier
-
removeUnusedTransferConnectoids
public void removeUnusedTransferConnectoids(ServiceNetworkLayers serviceNetworkLayers, boolean recreateManagedConnectoidIds)
Remove all directed connectoids for which no service nodes' physical nodes on any of the given layers match its access nodes, i.e., the directed connectoid has no routed services that visit it, and therefore they are not explicitly, but implicitly dangling and are removedfire #RecreatedZoningEntitiesManagedIdsEvent upon completion with remaining connectoids
- Specified by:
removeUnusedTransferConnectoids
in interfaceZoningModifier
- Parameters:
serviceNetworkLayers
- to check againstrecreateManagedConnectoidIds
- when true recreate connectoid ids, when false do not
-
recreateManagedIdEntities
public void recreateManagedIdEntities()
Recreate all managed id entities owned by this zoningfires #RecreatedZoningManagedIdsEvent after each managedIds container that is has updated
- Specified by:
recreateManagedIdEntities
in interfaceZoningModifier
-
addListener
public void addListener(ZoningModifierListener listener)
Register listener for all its supported event types fired by a zoning modifier- Specified by:
addListener
in interfaceZoningModifierEventProducer
- Parameters:
listener
- to register
-
addListener
public void addListener(ZoningModifierListener listener, ZoningModifierEventType eventType)
Register listeners for events fired by a zoning modifier- Specified by:
addListener
in interfaceZoningModifierEventProducer
- Parameters:
listener
- to registereventType
- to register listener for
-
removeListener
public void removeListener(ZoningModifierListener listener, ZoningModifierEventType eventType)
Remove listener for given event type- Specified by:
removeListener
in interfaceZoningModifierEventProducer
- Parameters:
listener
- to removeeventType
- to unregister listener for
-
removeListener
public void removeListener(ZoningModifierListener listener)
Remove listener for all event types it is registered for- Specified by:
removeListener
in interfaceZoningModifierEventProducer
- Parameters:
listener
- to remove
-
-