public class Settings
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and 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.
|
Constructor and Description |
---|
Settings()
Create new settings.
|
Settings(boolean ampm,
int fontsize,
Alarm[] alarms,
boolean autosave,
java.lang.String filename)
Create new settings.
|
Settings(java.lang.String filename)
Create new settings.
|
Modifier and Type | Method and 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
|
protected boolean ampm
protected int fontsize
protected java.util.List<Alarm> alarms
protected java.lang.String filename
protected boolean autosave
public Settings()
public Settings(java.lang.String filename)
filename
- The filename.public Settings(boolean ampm, int fontsize, Alarm[] alarms, boolean autosave, java.lang.String filename)
ampm
- The ampm format indicator.alarms
- The alarms.autosave
- The autosave option.filename
- The filename.public boolean isAMPM()
public void setAMPM(boolean ampm)
ampm
- The ampm mode.public int getFontsize()
public void setFontsize(int fontsize)
fontsize
- The fontsize.public Alarm[] getAlarms()
public void addAlarm(Alarm alarm)
alarm
- The alarm.public void removeAlarm(Alarm alarm)
alarm
- The alarm.public boolean isAutosave()
public void setAutosave(boolean autosave)
autosave
- public void setAlarms(Alarm[] alarms)
alarms
- The alarms.public java.lang.String getFilename()
public void setFilename(java.lang.String filename)
filename
- The filename.protected void save0()
protected java.lang.Object clone()
clone
in class java.lang.Object
public void save() throws java.io.IOException
java.io.IOException
public static Settings loadSettings(java.lang.String settings_loc)
settings_loc
- The settings location.