public class PhoneAlarm
extends java.lang.Object
Constructor and Description |
---|
PhoneAlarm(java.util.Calendar alarmTime,
boolean isOneTimeAlarm,
boolean isForAllDays,
int[] alarmDays,
int alarmNumber)
Creates a new instance of PhoneAlarm.
|
PhoneAlarm(java.util.Calendar alarmTime,
boolean isOneTimeAlarm,
boolean isForAllDays,
java.util.Set<? extends java.lang.Integer> alarmDays,
int alarmNumber)
Creates a new instance of PhoneAlarm.
|
PhoneAlarm(int alarmNumber,
java.lang.String dateString,
java.lang.String timeString,
java.lang.String daysString)
Creates a new instance of PhoneAlarm.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAlarmString()
Gets the alarm string for this alarm.
|
java.lang.String |
getDateString()
Get the date String for this alarm, if any.
|
java.util.Set<java.lang.Integer> |
getDays()
Returns the days at which this PhoneAlarm will start.
|
java.lang.String |
getDaysString()
Get the days String for this alarm.
|
int |
getNumber()
Returns the number (position) at which this PhoneAlarm
will be put in the phone.
|
java.util.Calendar |
getTime()
Returns the time at which this PhoneAlarm will start.
|
java.lang.String |
getTimeString()
Get the time String for this alarm.
|
boolean |
isForAllDays()
Tells if this PhoneAlarm is set for all days of the week.
|
boolean |
isOneTimeAlarm()
Tells if this PhoneAlarm is a one-time alarm.
|
static PhoneAlarm |
parseReponse(java.lang.String response)
Parses the given phone response and creates a PhoneAlarm that matches it.
|
void |
setDays(int[] alarmDays)
Sets the days at which this PhoneAlarm will start.
|
void |
setDays(java.util.Set<? extends java.lang.Integer> alarmDays)
Sets the days at which this PhoneAlarm will start.
|
void |
setForAllDays(boolean isForAllDays)
Sets if this PhoneAlarm is set for all days of the week.
|
void |
setNumber(int alarmNumber)
Sets the number (position) at which this PhoneAlarm
will be put in the phone.
|
void |
setOneTimeAlarm(boolean isOneTime)
Sets if this PhoneAlarm is a one-time alarm.
|
void |
setTime(java.util.Calendar c)
Sets the time at which this PhoneAlarm will start.
|
java.lang.String |
toString()
Returns a String representation of this PhoneAlarm.
|
public PhoneAlarm(java.util.Calendar alarmTime, boolean isOneTimeAlarm, boolean isForAllDays, int[] alarmDays, int alarmNumber)
alarmTime
- The time to start the alarm.isOneTimeAlarm
- Is the alarm one-time (include the date and the time)
or repetitive (include only the time).isForAllDays
- Is the alarm for all days of week.alarmDays
- The days to start the alarms on (if not for all days).alarmNumber
- The number of the alarm.public PhoneAlarm(java.util.Calendar alarmTime, boolean isOneTimeAlarm, boolean isForAllDays, java.util.Set<? extends java.lang.Integer> alarmDays, int alarmNumber)
alarmTime
- The time to start the alarm.isOneTimeAlarm
- Is the alarm one-time (include the date and the time)
or repetitive (include only the time).isForAllDays
- Is the alarm for all days of week.alarmDays
- The days to start the alarms on (if not for all days).alarmNumber
- The number of the alarm.public PhoneAlarm(int alarmNumber, java.lang.String dateString, java.lang.String timeString, java.lang.String daysString)
alarmNumber
- The number of the alarm.dateString
- The date string for the alarm in "DD/MM/YY" format
(or null for repetitive alarms).timeString
- The time string for the alarm in "HH:MM:SS" format (can't be null).daysString
- The days to start the alarms on, in "N,N,N" format
(can be null or "0" for all days).public java.util.Calendar getTime()
public boolean isOneTimeAlarm()
public boolean isForAllDays()
public java.util.Set<java.lang.Integer> getDays()
public int getNumber()
public void setTime(java.util.Calendar c)
c
- the time at which this PhoneAlarm will start.public void setOneTimeAlarm(boolean isOneTime)
isOneTime
- TRUE if this PhoneAlarm is a one-time alarm.public void setForAllDays(boolean isForAllDays)
isForAllDays
- TRUE if this PhoneAlarm is set for all days of the week.public void setDays(int[] alarmDays)
alarmDays
- the days at which this PhoneAlarm will start or
null in case of everyday alarms.public void setDays(java.util.Set<? extends java.lang.Integer> alarmDays)
alarmDays
- the days at which this PhoneAlarm will start or
null in case of everyday alarms.public void setNumber(int alarmNumber)
alarmNumber
- the number at which this PhoneAlarm
will be put in the phone.public java.lang.String getAlarmString()
public java.lang.String getDateString()
public java.lang.String getTimeString()
public java.lang.String getDaysString()
public static PhoneAlarm parseReponse(java.lang.String response)
response
- The response to parse.public java.lang.String toString()
toString
in class java.lang.Object