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 SummaryFields 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 SummaryAll 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- 
ampmprotected boolean ampm The ampm time format.
 - 
fontsizeprotected int fontsize The font size.
 - 
alarmsprotected java.util.List<Alarm> alarms The alarms.
 - 
filenameprotected java.lang.String filename The actual filename for this settings.
 - 
autosaveprotected boolean autosave The autosave flag.
 
- 
 - 
Constructor Detail- 
Settingspublic Settings() Create new settings.
 - 
Settingspublic Settings(java.lang.String filename) Create new settings.- Parameters:
- filename- The filename.
 
 - 
Settingspublic 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- 
isAMPMpublic boolean isAMPM() Test is ampm format.- Returns:
- True, if ampm format.
 
 - 
setAMPMpublic void setAMPM(boolean ampm) Set the ampm mode.- Parameters:
- ampm- The ampm mode.
 
 - 
getFontsizepublic int getFontsize() Get the font size.- Returns:
- The font size.
 
 - 
setFontsizepublic void setFontsize(int fontsize) Set the font size- Parameters:
- fontsize- The fontsize.
 
 - 
getAlarmspublic Alarm[] getAlarms() Get the alarms.- Returns:
- The alarms.
 
 - 
addAlarmpublic void addAlarm(Alarm alarm) Add a new alarm.- Parameters:
- alarm- The alarm.
 
 - 
removeAlarmpublic void removeAlarm(Alarm alarm) Remove an alarm.- Parameters:
- alarm- The alarm.
 
 - 
isAutosavepublic boolean isAutosave() Test if autosave.- Returns:
- True, if autosave.
 
 - 
setAutosavepublic void setAutosave(boolean autosave) Test the autosave option.- Parameters:
- autosave-
 
 - 
setAlarmspublic void setAlarms(Alarm[] alarms) Set the alarms.- Parameters:
- alarms- The alarms.
 
 - 
getFilenamepublic java.lang.String getFilename() Get the filename.- Returns:
- The filename.
 
 - 
setFilenamepublic void setFilename(java.lang.String filename) Set the filename.- Parameters:
- filename- The filename.
 
 - 
save0protected void save0() Save settings without exception.
 - 
cloneprotected 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 class- java.lang.Object
- Returns:
- a clone of this instance.
 - 
savepublic void save() throws java.io.IOExceptionSave the settings.- Throws:
- java.io.IOException
 
 - 
loadSettingspublic static Settings loadSettings(java.lang.String settings_loc) Load the settings.- Parameters:
- settings_loc- The settings location.
- Returns:
- The loaded settings.
 
 
 
- 
 
-