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 ZoningzoningThe 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 voidaddListener(ZoningModifierListener listener, ZoningModifierEventType eventType)Register listeners for events fired by a zoning modifierprotected voidfireEvent(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 interfacevoidrecreateConnectoidIds()recreate all internal ids fo all connectoids both od and transfer connectoidsvoidrecreateTransferZoneGroupIds()recreate all internal ids fo all zones both od and transfer zonesvoidrecreateZoneIds()recreate all internal ids fo all zones both od and transfer zonesvoidremoveDanglingTransferZoneGroups()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.voidremoveDanglingZones()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.voidremoveListener(ZoningModifierListener listener)Remove listener for all event types it is registered forvoidremoveListener(ZoningModifierListener listener, ZoningModifierEventType eventType)Remove listener for given event typeprotected voidremoveZone(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:
fireEventin 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:
recreateConnectoidIdsin interfaceZoningModifier
-
recreateZoneIds
public void recreateZoneIds()
recreate all internal ids fo all zones both od and transfer zones- Specified by:
recreateZoneIdsin interfaceZoningModifier
-
recreateTransferZoneGroupIds
public void recreateTransferZoneGroupIds()
recreate all internal ids fo all zones both od and transfer zones- Specified by:
recreateTransferZoneGroupIdsin 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:
removeDanglingZonesin 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:
removeDanglingTransferZoneGroupsin interfaceZoningModifier
-
addListener
public void addListener(ZoningModifierListener listener, ZoningModifierEventType eventType)
Register listeners for events fired by a zoning modifier- Specified by:
addListenerin 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:
removeListenerin 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:
removeListenerin interfaceZoningModifierEventProducer- Parameters:
listener- to remove
-
-