Package jadex.bdiv3.examples.alarmclock
Class AlarmclockAgent
- java.lang.Object
-
- jadex.bdiv3.examples.alarmclock.AlarmclockAgent
-
public class AlarmclockAgent extends java.lang.Object
Alarm clock that notifies on alarm.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AlarmclockAgent.AlarmGoal
Check alarm time and trigger notification if necessary.static class
AlarmclockAgent.NotifyGoal
Notify about an alarmstatic class
AlarmclockAgent.PlaySongGoal
Play a song
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Alarm>
alarms
The alarms that have been set.protected ClockFrame
gui
The gui.protected Settings
settings
The loaded settings.protected java.lang.String
settingsfile
The filename of the alarm clock settings.
-
Constructor Summary
Constructors Constructor Description AlarmclockAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlarm(Alarm alarm)
Add an alarm.IFuture<java.lang.Void>
body(IInternalAccess agent)
Start the agentAlarm[]
getAlarms()
Get the alarmsClockFrame
getGui()
Get the gui.Settings
getSettings()
Get the settings.void
removeAlarm(Alarm alarm)
Remove an alarm.void
setSettings(Settings settings)
Set the settings and update the alarms.
-
-
-
Field Detail
-
settingsfile
protected java.lang.String settingsfile
The filename of the alarm clock settings.
-
settings
protected Settings settings
The loaded settings.
-
gui
protected ClockFrame gui
The gui.
-
alarms
protected java.util.Set<Alarm> alarms
The alarms that have been set.
-
-
Method Detail
-
body
public IFuture<java.lang.Void> body(IInternalAccess agent)
Start the agent
-
getSettings
public Settings getSettings()
Get the settings.
-
setSettings
public void setSettings(Settings settings)
Set the settings and update the alarms.
-
getGui
public ClockFrame getGui()
Get the gui.
-
addAlarm
public void addAlarm(Alarm alarm)
Add an alarm.
-
removeAlarm
public void removeAlarm(Alarm alarm)
Remove an alarm.
-
getAlarms
public Alarm[] getAlarms()
Get the alarms
-
-