public class AlarmClock
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<AlarmClock> |
CREATOR |
Modifier | Constructor and Description |
---|---|
|
AlarmClock()
Initializes an unset alarm clock with default parameters.
|
|
AlarmClock(AlarmClock alarmClock)
Copy constructor.
|
protected |
AlarmClock(android.os.Parcel in)
Parcel constructor.
|
|
AlarmClock(java.lang.String origin,
java.lang.String destination,
DaysOfWeek repeatDays,
java.util.Calendar alarmTime,
java.util.Calendar arrivalTime,
int prepHour,
int prepMinute,
java.util.Calendar upperBoundTime)
A copy constructor with explicit variables.
|
|
AlarmClock(java.lang.String origin,
java.lang.String destination,
DaysOfWeek repeatDays,
DaysOfWeek.DAY alarmDay,
int alarmHour,
int alarmMinute,
DaysOfWeek.DAY arrivalDay,
int arrivalHour,
int arrivalMinute,
int prepHour,
int prepMinute,
DaysOfWeek.DAY upperBoundDay,
int upperBoundHour,
int upperBoundMinute)
A copy constructor with very explicit values.
|
Modifier and Type | Method and Description |
---|---|
void |
defaultAlarmSettings()
Defaults any current settings and turns off any running alarms.
|
int |
describeContents() |
java.util.Calendar |
getAlarmTime()
Gets the internal alarm time for this alarm clock.
|
long |
getAlarmTimeMillis()
Gets the internal alarm time for this alarm clock in milliseconds since the "epoch".
|
java.util.Calendar |
getArrivalTime() |
long |
getArrivalTimeMillis() |
java.lang.String |
getDestination()
Gets the place the user is going to.
|
java.lang.String |
getOrigin()
Gets the place the user is leaving from.
|
java.util.Calendar |
getPrepTime() |
long |
getPrepTimeMillis() |
DaysOfWeek |
getRepeatDays()
Gets the days that this alarm is set to repeat on.
|
java.util.Calendar |
getUpperBoundTime() |
long |
getUpperBoundTimeMillis() |
java.util.UUID |
getUUID()
Gets the universally unique identification associated with this particular alarm clock.
|
boolean |
isGedderOn() |
boolean |
isOn()
Tells you whether the alarm is currently set or not.
|
void |
setAlarmTime(java.util.Calendar future)
Sets the internal alarm time according to the Calendar's
Calendar.DAY_OF_WEEK ,
Calendar.HOUR , and Calendar.MINUTE keys. |
void |
setAlarmTime(DaysOfWeek.DAY day,
int hour,
int minute)
Works the same as its public counterpart,
setAlarmTime(Calendar) , but uses explicit
inputs. |
void |
setArrivalTime(java.util.Calendar future)
Sets the arrival time according to the Calendar's
Calendar.DAY_OF_WEEK ,
Calendar.HOUR , and Calendar.MINUTE keys. |
void |
setArrivalTime(DaysOfWeek.DAY day,
int hour,
int minute)
Works the same as its public counterpart,
setArrivalTime(Calendar) , but uses explicit
inputs. |
void |
setDestination(java.lang.String destination)
Sets destination for the purpose of the Gedder alarm.
|
void |
setOrigin(java.lang.String origin)
Sets origin for the purpose of the Gedder alarm.
|
void |
setPrepTime(int hour,
int minute)
Sets the time it takes to get prepared for departure after the alarm triggers.
|
void |
setUpperBoundTime(java.util.Calendar future)
Sets the user's selected time according to the Calendar's
Calendar.DAY_OF_WEEK ,
Calendar.HOUR , and Calendar.MINUTE keys. |
void |
setUpperBoundTime(DaysOfWeek.DAY day,
int hour,
int minute)
Works the same as its public counterpart,
setUpperBoundTime(Calendar) , but uses
explicit inputs. |
void |
toggleGedder() |
void |
turnOff()
Cancels any alarm associated with this alarm clock instance.
|
void |
turnOn()
Sets a new alarm clock through intents to the Android OS.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<AlarmClock> CREATOR
public AlarmClock()
public AlarmClock(AlarmClock alarmClock)
alarmClock
- The alarm clock instance to copy.public AlarmClock(java.lang.String origin, java.lang.String destination, DaysOfWeek repeatDays, java.util.Calendar alarmTime, java.util.Calendar arrivalTime, int prepHour, int prepMinute, java.util.Calendar upperBoundTime)
origin
- The place the user is leaving from.destination
- The place the user wants to get to.repeatDays
- The days this alarm clock will repeat.alarmTime
- The time for which this alarm is set (or going to be set for).arrivalTime
- The time the user needs to get to their destination.prepHour
- The hour portion of the time it takes the user to get prepared for
travel after the alarm goes off.prepMinute
- The minute portion of the time it takes the user to get prepared for
travel after the alarm goes off.upperBoundTime
- The user selected alarm time. If Gedder is activated, this may
differ from the actual alarm time.public AlarmClock(java.lang.String origin, java.lang.String destination, DaysOfWeek repeatDays, DaysOfWeek.DAY alarmDay, int alarmHour, int alarmMinute, DaysOfWeek.DAY arrivalDay, int arrivalHour, int arrivalMinute, int prepHour, int prepMinute, DaysOfWeek.DAY upperBoundDay, int upperBoundHour, int upperBoundMinute)
origin
- The place the user is leaving from.destination
- The place the user wants to get to.repeatDays
- The days this alarm clock will repeat.alarmDay
- The day portion of the time for which this alarm is to be set.alarmHour
- The hour portion of the time for which this alarm is to be set.alarmMinute
- The minute portion of the time for which this alarm is to be set.arrivalDay
- The day portion of the time the user needs to get to their
destination.arrivalHour
- The hour portion of the time the user needs to get to their
destination.arrivalMinute
- The minute portion of the time the user needs to get to their
destination.prepHour
- The hour portion of the time it takes the user to get prepared for
travel after the alarm goes off.prepMinute
- The minute portion of the time it takes the user to get prepared for
travel after the alarm goes off.upperBoundDay
- The day portion of the user selected alarm time.upperBoundHour
- The hour portion of the user selected alarm time.upperBoundMinute
- The minute portion of the user selected alarm time.protected AlarmClock(android.os.Parcel in)
in
- The parcel to read.public void defaultAlarmSettings()
public void setOrigin(java.lang.String origin)
origin
- The origin to set to. Must be non-null.java.lang.IllegalArgumentException
- If origin is null.public void setDestination(java.lang.String destination)
destination
- The destination to set to. Must be non-null.java.lang.IllegalArgumentException
- If destination is null.public void setAlarmTime(java.util.Calendar future)
Calendar.DAY_OF_WEEK
,
Calendar.HOUR
, and Calendar.MINUTE
keys.future
- A calendar that must have valid values for the keys
Calendar.DAY_OF_WEEK
, Calendar.HOUR
, and
Calendar.MINUTE
.public void setAlarmTime(DaysOfWeek.DAY day, int hour, int minute)
setAlarmTime(Calendar)
, but uses explicit
inputs.day
- The day to set the internal alarm to.hour
- The hour to set the internal alarm to.minute
- The minute to set the internal alarm to.setAlarmTime(Calendar)
public void setArrivalTime(java.util.Calendar future)
Calendar.DAY_OF_WEEK
,
Calendar.HOUR
, and Calendar.MINUTE
keys.future
- A calendar that must have valid values for the keys
Calendar.DAY_OF_WEEK
, Calendar.HOUR
, and
Calendar.MINUTE
.public void setArrivalTime(DaysOfWeek.DAY day, int hour, int minute)
setArrivalTime(Calendar)
, but uses explicit
inputs.day
- The day to set the arrival time to.hour
- The hour to set the arrival time to.minute
- The minute to set the arrival time to.setArrivalTime(Calendar)
public void setPrepTime(int hour, int minute)
hour
- The hours it takes to get prepared.minute
- The minutes it takes to get prepared.public void setUpperBoundTime(java.util.Calendar future)
Calendar.DAY_OF_WEEK
,
Calendar.HOUR
, and Calendar.MINUTE
keys.future
- A calendar that must have valid values for the keys
Calendar.DAY_OF_WEEK
, Calendar.HOUR
, and
Calendar.MINUTE
.public void setUpperBoundTime(DaysOfWeek.DAY day, int hour, int minute)
setUpperBoundTime(Calendar)
, but uses
explicit inputs.day
- The day the user selects for the alarm.hour
- The hour the user selects for the alarm.minute
- The minute the user selects for the alarm.setUpperBoundTime(Calendar)
public void toggleGedder()
public void turnOn()
AlarmReceiver
will receive
this intent.
If the Gedder alarm is also required, tells the GedderAlarmManager
to set up the
Gedder services for this particular alarm.public void turnOff()
public java.util.UUID getUUID()
public java.lang.String getOrigin()
public java.lang.String getDestination()
public DaysOfWeek getRepeatDays()
public java.util.Calendar getAlarmTime()
public long getAlarmTimeMillis()
public java.util.Calendar getArrivalTime()
public long getArrivalTimeMillis()
public java.util.Calendar getPrepTime()
public long getPrepTimeMillis()
public java.util.Calendar getUpperBoundTime()
public long getUpperBoundTimeMillis()
public boolean isOn()
public boolean isGedderOn()
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public int describeContents()
describeContents
in interface android.os.Parcelable