Package cz.cvut.fel.omo.SmartHome.report
Class EventsKeeper
- java.lang.Object
-
- cz.cvut.fel.omo.SmartHome.report.EventsKeeper
-
public class EventsKeeper extends java.lang.Object
Class that keeps all events and collect them
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Event>
events
private static EventsKeeper
instance
-
Constructor Summary
Constructors Constructor Description EventsKeeper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInteractionEvent(java.lang.String from, AbstractDevice device)
Creating a new interaction event for reports and adds it to the listvoid
addRepairEvent(java.lang.String from, AbstractDevice device)
Creating a new repair event for reports and adds it to the listvoid
addStrategyEvent(java.lang.String from, AbstractDevice device)
Creating a new strategy event for reports and adds it to the listvoid
addWeatherEvent(java.lang.String from, AbstractDevice device)
Creating a new weather event for reports and adds it to the listjava.util.List<Event>
getEvents()
static EventsKeeper
getInstance()
-
-
-
Field Detail
-
events
private java.util.List<Event> events
-
instance
private static volatile EventsKeeper instance
-
-
Method Detail
-
getInstance
public static EventsKeeper getInstance()
-
addInteractionEvent
public void addInteractionEvent(java.lang.String from, AbstractDevice device)
Creating a new interaction event for reports and adds it to the list- Parameters:
from
- initiator of interactiondevice
- object of interaction
-
addRepairEvent
public void addRepairEvent(java.lang.String from, AbstractDevice device)
Creating a new repair event for reports and adds it to the list- Parameters:
from
- initiator of interactiondevice
- object of interaction
-
addWeatherEvent
public void addWeatherEvent(java.lang.String from, AbstractDevice device)
Creating a new weather event for reports and adds it to the list- Parameters:
from
- initiator of interactiondevice
- object of interaction
-
addStrategyEvent
public void addStrategyEvent(java.lang.String from, AbstractDevice device)
Creating a new strategy event for reports and adds it to the list- Parameters:
from
- initiator of interactiondevice
- object of interaction
-
getEvents
public java.util.List<Event> getEvents()
-
-