Package org.goplanit.zoning.modifier
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, 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 fo all connectoids both od and transfer connectoidsvoid
recreateTransferZoneGroupIds()
recreate all internal ids fo all zones both od and transfer zonesvoid
recreateZoneIds()
recreate all internal ids fo all zones both od and transfer zonesvoid
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
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 typeprotected 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
-
recreateConnectoidIds
public void recreateConnectoidIds()
recreate all internal ids fo all connectoids both od and transfer connectoids- Specified by:
recreateConnectoidIds
in interfaceZoningModifier
-
recreateZoneIds
public void recreateZoneIds()
recreate all internal ids fo all zones both od and transfer zones- Specified by:
recreateZoneIds
in interfaceZoningModifier
-
recreateTransferZoneGroupIds
public void recreateTransferZoneGroupIds()
recreate all internal ids fo all zones both od and transfer zones- Specified by:
recreateTransferZoneGroupIds
in interfaceZoningModifier
-
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 group- 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.- Specified by:
removeDanglingTransferZoneGroups
in interfaceZoningModifier
-
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
-
-