avrora.sim
Class EnergyControlImpl

java.lang.Object
  extended byavrora.sim.EnergyControlImpl
All Implemented Interfaces:
EnergyControl

public class EnergyControlImpl
extends java.lang.Object
implements EnergyControl

implementation of energy control handles subsrciption of monitors and consumers


Constructor Summary
EnergyControlImpl()
          create a new instance of energy control
 
Method Summary
 void addConsumer(Energy energy)
          add consumer
 java.util.LinkedList getConsumers()
          get list of consumers
 void stateChange(Energy energy)
          update the state of a device
 void subscribe(EnergyMonitorBase energyMonitor)
          add energy monitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnergyControlImpl

public EnergyControlImpl()
create a new instance of energy control

Method Detail

subscribe

public void subscribe(EnergyMonitorBase energyMonitor)
add energy monitor

Specified by:
subscribe in interface EnergyControl
Parameters:
energyMonitor - monitor

addConsumer

public void addConsumer(Energy energy)
add consumer

Specified by:
addConsumer in interface EnergyControl
Parameters:
energy - consumer

getConsumers

public java.util.LinkedList getConsumers()
get list of consumers

Specified by:
getConsumers in interface EnergyControl
Returns:
conumer list

stateChange

public void stateChange(Energy energy)
update the state of a device

Specified by:
stateChange in interface EnergyControl
Parameters:
energy - the energy model of the device