Package de.fzi.power.interpreter
Class PowerModelUpdaterSwitch
- java.lang.Object
-
- org.eclipse.emf.ecore.util.Switch<T>
-
- de.fzi.power.infrastructure.util.InfrastructureSwitch<Void>
-
- de.fzi.power.interpreter.PowerModelUpdaterSwitch
-
public class PowerModelUpdaterSwitch extends InfrastructureSwitch<Void>
Switch used by an interpreter to update the power models for elements depending on the {@see PowerAssemblyContext} that has been set for them.
-
-
Field Summary
-
Fields inherited from class de.fzi.power.infrastructure.util.InfrastructureSwitch
modelPackage
-
-
Constructor Summary
Constructors Constructor Description PowerModelUpdaterSwitch(PowerModelRegistry registry, CalculatorInstantiator calcInstantiator)
Creates the switch for updating the power models registered in thePowerModelRegistry
of an interpreted power infrastructure model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Void
caseMountedPowerDistributionUnit(MountedPowerDistributionUnit mountedPdu)
Update the power model for aMountedPowerDistributionUnit
.Void
casePowerConsumingResourceSet(PowerConsumingResourceSet powerConsumingResource)
Update the power model for a power-consuming resource (PowerConsumingResource
) such as a CPU, HDD etc.Void
casePowerDistributionUnit(PowerDistributionUnit powerDistributionUnit)
Update the power model for aPowerDistributionUnit
.Void
casePowerInfrastructureRepository(PowerInfrastructureRepository repo)
Returns the result of interpreting the object as an instance of 'Power Infrastructure Repository'.Void
casePowerProvidingEntity(PowerProvidingEntity ppe)
Update the power model for aPowerProvidingEntity
.Void
caseStatefulPowerConsumingResourceSet(StatefulPowerConsumingResourceSet powerConsumingResource)
Returns the result of interpreting the object as an instance of 'Stateful Power Consuming Resource Set'.-
Methods inherited from class de.fzi.power.infrastructure.util.InfrastructureSwitch
caseAbstractPowerConsumingResource, caseEntity, caseIdentifier, caseNamedElement, casePowerConsumingEntity, casePowerConsumingProvidingEntity, defaultCase, doSwitch, isSwitchFor
-
-
-
-
Constructor Detail
-
PowerModelUpdaterSwitch
public PowerModelUpdaterSwitch(PowerModelRegistry registry, CalculatorInstantiator calcInstantiator)
Creates the switch for updating the power models registered in thePowerModelRegistry
of an interpreted power infrastructure model.- Parameters:
registry
- The registry onto which the power models are registered.calcInstantiator
- The factory used for instantiating the respective updated elements.
-
-
Method Detail
-
casePowerInfrastructureRepository
public Void casePowerInfrastructureRepository(PowerInfrastructureRepository repo)
Description copied from class:InfrastructureSwitch
Returns the result of interpreting the object as an instance of 'Power Infrastructure Repository'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
casePowerInfrastructureRepository
in classInfrastructureSwitch<Void>
- Parameters:
repo
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Power Infrastructure Repository'.
- See Also:
doSwitch(EObject)
-
casePowerDistributionUnit
public Void casePowerDistributionUnit(PowerDistributionUnit powerDistributionUnit)
Update the power model for aPowerDistributionUnit
.- Overrides:
casePowerDistributionUnit
in classInfrastructureSwitch<Void>
- Parameters:
The
- updated PDU.- Returns:
- Nothing.
- See Also:
doSwitch(EObject)
-
casePowerProvidingEntity
public Void casePowerProvidingEntity(PowerProvidingEntity ppe)
Update the power model for aPowerProvidingEntity
.- Overrides:
casePowerProvidingEntity
in classInfrastructureSwitch<Void>
- Parameters:
The
- updatedPowerProvidingEntity
entity.- Returns:
- Nothing.
- See Also:
doSwitch(EObject)
-
caseMountedPowerDistributionUnit
public Void caseMountedPowerDistributionUnit(MountedPowerDistributionUnit mountedPdu)
Update the power model for aMountedPowerDistributionUnit
.- Overrides:
caseMountedPowerDistributionUnit
in classInfrastructureSwitch<Void>
- Parameters:
The
- updated mounted PDU.- Returns:
- Nothing.
- See Also:
doSwitch(EObject)
-
casePowerConsumingResourceSet
public Void casePowerConsumingResourceSet(PowerConsumingResourceSet powerConsumingResource)
Update the power model for a power-consuming resource (PowerConsumingResource
) such as a CPU, HDD etc.- Overrides:
casePowerConsumingResourceSet
in classInfrastructureSwitch<Void>
- Parameters:
powerConsumingResource
- The resource for which the power model is updated.- Returns:
- Nothing.
- See Also:
doSwitch(EObject)
-
caseStatefulPowerConsumingResourceSet
public Void caseStatefulPowerConsumingResourceSet(StatefulPowerConsumingResourceSet powerConsumingResource)
Description copied from class:InfrastructureSwitch
Returns the result of interpreting the object as an instance of 'Stateful Power Consuming Resource Set'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseStatefulPowerConsumingResourceSet
in classInfrastructureSwitch<Void>
- Parameters:
powerConsumingResource
- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Stateful Power Consuming Resource Set'.
- See Also:
doSwitch(EObject)
-
-