Package jadex.bdi.examples.alarmclock
Class Settings
- java.lang.Object
-
- jadex.bdi.examples.alarmclock.Settings
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class Settings extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
Contains all settings that need to be amde persist.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Alarm>
alarms
The alarms.protected boolean
ampm
The ampm time format.protected boolean
autosave
The autosave flag.protected java.lang.String
filename
The actual filename for this settings.protected int
fontsize
The font size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlarm(Alarm alarm)
Add a new alarm.protected java.lang.Object
clone()
Creates and returns a copy of this object.Alarm[]
getAlarms()
Get the alarms.java.lang.String
getFilename()
Get the filename.int
getFontsize()
Get the font size.boolean
isAMPM()
Test is ampm format.boolean
isAutosave()
Test if autosave.static Settings
loadSettings(java.lang.String settings_loc)
Load the settings.void
removeAlarm(Alarm alarm)
Remove an alarm.void
save()
Save the settings.protected void
save0()
Save settings without exception.void
setAlarms(Alarm[] alarms)
Set the alarms.void
setAMPM(boolean ampm)
Set the ampm mode.void
setAutosave(boolean autosave)
Test the autosave option.void
setFilename(java.lang.String filename)
Set the filename.void
setFontsize(int fontsize)
Set the font size
-
-
-
Field Detail
-
ampm
protected boolean ampm
The ampm time format.
-
fontsize
protected int fontsize
The font size.
-
alarms
protected java.util.List<Alarm> alarms
The alarms.
-
filename
protected java.lang.String filename
The actual filename for this settings.
-
autosave
protected boolean autosave
The autosave flag.
-
-
Constructor Detail
-
Settings
public Settings()
Create new settings.
-
Settings
public Settings(java.lang.String filename)
Create new settings.- Parameters:
filename
- The filename.
-
Settings
public Settings(boolean ampm, int fontsize, Alarm[] alarms, boolean autosave, java.lang.String filename)
Create new settings.- Parameters:
ampm
- The ampm format indicator.alarms
- The alarms.autosave
- The autosave option.filename
- The filename.
-
-
Method Detail
-
isAMPM
public boolean isAMPM()
Test is ampm format.- Returns:
- True, if ampm format.
-
setAMPM
public void setAMPM(boolean ampm)
Set the ampm mode.- Parameters:
ampm
- The ampm mode.
-
getFontsize
public int getFontsize()
Get the font size.- Returns:
- The font size.
-
setFontsize
public void setFontsize(int fontsize)
Set the font size- Parameters:
fontsize
- The fontsize.
-
getAlarms
public Alarm[] getAlarms()
Get the alarms.- Returns:
- The alarms.
-
addAlarm
public void addAlarm(Alarm alarm)
Add a new alarm.- Parameters:
alarm
- The alarm.
-
removeAlarm
public void removeAlarm(Alarm alarm)
Remove an alarm.- Parameters:
alarm
- The alarm.
-
isAutosave
public boolean isAutosave()
Test if autosave.- Returns:
- True, if autosave.
-
setAutosave
public void setAutosave(boolean autosave)
Test the autosave option.- Parameters:
autosave
-
-
setAlarms
public void setAlarms(Alarm[] alarms)
Set the alarms.- Parameters:
alarms
- The alarms.
-
getFilename
public java.lang.String getFilename()
Get the filename.- Returns:
- The filename.
-
setFilename
public void setFilename(java.lang.String filename)
Set the filename.- Parameters:
filename
- The filename.
-
save0
protected void save0()
Save settings without exception.
-
clone
protected java.lang.Object clone()
Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object- Overrides:
clone
in classjava.lang.Object
- Returns:
- a clone of this instance.
-
save
public void save() throws java.io.IOException
Save the settings.- Throws:
java.io.IOException
-
loadSettings
public static Settings loadSettings(java.lang.String settings_loc)
Load the settings.- Parameters:
settings_loc
- The settings location.- Returns:
- The loaded settings.
-
-