public class Alarm
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected boolean |
active
The active state.
|
protected long |
alarmdate
Cached alarm date.
|
static java.lang.String[] |
ALARMS
All alarm modes.
|
protected boolean |
calc_allowed |
static java.lang.String |
DAILY
Alarm mode daily.
|
protected java.lang.String |
filename
The alarm sound filename.
|
static java.lang.String |
HOURLY
Alarm mode hourly.
|
protected java.lang.String |
message
The alaram message.
|
protected java.lang.String |
mode
The alarm mode.
|
static java.lang.String |
MONTHLY
Alarm mode monthly.
|
static int |
NO_ALARM
No alarmtime -> calculate.
|
static java.lang.String |
ONCE
Alarm mode once.
|
java.beans.PropertyChangeSupport |
pcs
The helper object for bean events.
|
protected Time |
time
The alarm time.
|
static java.lang.String |
TIMER
Alarm mode timer.
|
static int |
UNKNOWN
Unknown alarmtime -> calculate.
|
static java.lang.String |
WEEKLY
Alarm mode weekly.
|
static java.lang.String |
YEARLY
Alarm mode yearly.
|
Constructor and Description |
---|
Alarm()
Create a new alarm.
|
Alarm(java.lang.String mode,
Time time,
java.lang.String filename,
java.lang.String message,
boolean active)
Create a new alarm.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
protected java.lang.Object |
clone()
Creates and returns a copy of this object.
|
long |
getAlarmtime(long currenttime)
Get the alarm time.
|
java.lang.String |
getFilename()
Get the filename.
|
java.net.URL |
getFilenameUrl()
Get the filename.
|
java.lang.String |
getMessage()
Get the message.
|
java.lang.String |
getMode()
Get the mode.
|
Time |
getTime()
Get the alarm time.
|
boolean |
isActive()
Test if the alarm is active.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
void |
setActive(boolean active)
Set the alarm state.
|
void |
setAlarmtime(long alarmdate)
Save the alarmtime.
|
void |
setFilename(java.lang.String filename)
Set the filename.
|
void |
setMessage(java.lang.String message)
Set the message.
|
void |
setMode(java.lang.String mode)
Set the mode.
|
void |
setNextAlarmtime(long currenttime)
Calculate and save the next alarmtime.
|
void |
setTime(Time time)
Set the alarm time.
|
java.lang.String |
toString()
Get the string representation.
|
void |
triggerd()
Indicate that an alarm occurred.
|
public static final java.lang.String TIMER
public static final java.lang.String ONCE
public static final java.lang.String HOURLY
public static final java.lang.String DAILY
public static final java.lang.String WEEKLY
public static final java.lang.String MONTHLY
public static final java.lang.String YEARLY
public static final java.lang.String[] ALARMS
public static final int UNKNOWN
public static final int NO_ALARM
protected java.lang.String mode
protected java.lang.String filename
protected java.lang.String message
protected Time time
protected long alarmdate
protected boolean calc_allowed
protected boolean active
public transient java.beans.PropertyChangeSupport pcs
public Alarm()
public Alarm(java.lang.String mode, Time time, java.lang.String filename, java.lang.String message, boolean active)
mode
- The alarm mode (once, hourly, daily, weekly, monthly, yearly)time
- The alarm time.filename
- The alarm sound.message
- The alarm message.public java.lang.String getMode()
public void setMode(java.lang.String mode)
mode
- The mode.public java.lang.String getFilename()
public java.net.URL getFilenameUrl()
public void setFilename(java.lang.String filename)
filename
- The filename.public java.lang.String getMessage()
public void setMessage(java.lang.String message)
message
- The message.public long getAlarmtime(long currenttime)
public void setAlarmtime(long alarmdate)
alarmdate
- The alarmdate.public void triggerd()
public void setNextAlarmtime(long currenttime)
public boolean isActive()
public void setActive(boolean active)
active
- True for active.public Time getTime()
public void setTime(Time time)
time
- The alarm time.protected java.lang.Object clone()
clone
in class java.lang.Object
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removed.public java.lang.String toString()
toString
in class java.lang.Object