Package jadex.bdiv3.examples.alarmclock
Class Settings
- java.lang.Object
-
- jadex.bdiv3.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.SerializableContains 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>alarmsThe alarms.protected booleanampmThe ampm time format.protected booleanautosaveThe autosave flag.protected java.lang.StringfilenameThe actual filename for this settings.protected intfontsizeThe font size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAlarm(Alarm alarm)Add a new alarm.protected java.lang.Objectclone()Creates and returns a copy of this object.Alarm[]getAlarms()Get the alarms.java.lang.StringgetFilename()Get the filename.intgetFontsize()Get the font size.booleanisAMPM()Test is ampm format.booleanisAutosave()Test if autosave.static SettingsloadSettings(java.lang.String settings_loc)Load the settings.voidremoveAlarm(Alarm alarm)Remove an alarm.voidsave()Save the settings.protected voidsave0()Save settings without exception.voidsetAlarms(Alarm[] alarms)Set the alarms.voidsetAMPM(boolean ampm)Set the ampm mode.voidsetAutosave(boolean autosave)Test the autosave option.voidsetFilename(java.lang.String filename)Set the filename.voidsetFontsize(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:
clonein classjava.lang.Object- Returns:
- a clone of this instance.
-
save
public void save() throws java.io.IOExceptionSave 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.
-
-