aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/util/EventLog.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/util/EventLog.java')
-rw-r--r--src/main/model/util/EventLog.java60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/main/model/util/EventLog.java b/src/main/model/util/EventLog.java
deleted file mode 100644
index 507c9b2..0000000
--- a/src/main/model/util/EventLog.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package model.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Represents a log of alarm system events.
- * We use the Singleton Design Pattern to ensure that there is only
- * one EventLog in the system and that the system has global access
- * to the single instance of the EventLog.
- */
-public class EventLog implements Iterable<Event> {
- /** the only EventLog in the system (Singleton Design Pattern) */
- private static EventLog theLog;
- private Collection<Event> events;
-
- /**
- * Prevent external construction.
- * (Singleton Design Pattern).
- */
- private EventLog() {
- events = new ArrayList<Event>();
- }
-
- /**
- * Gets instance of EventLog - creates it
- * if it doesn't already exist.
- * (Singleton Design Pattern)
- * @return instance of EventLog
- */
- public static EventLog getInstance() {
- if (theLog == null) {
- theLog = new EventLog();
- }
-
- return theLog;
- }
-
- /**
- * Adds an event to the event log.
- * @param e the event to be added
- */
- public void logEvent(Event e) {
- events.add(e);
- }
-
- /**
- * Clears the event log and logs the event.
- */
- public void clear() {
- events.clear();
- logEvent(new Event("Event log cleared."));
- }
-
- @Override
- public Iterator<Event> iterator() {
- return events.iterator();
- }
-}