public final class CalendarDay
extends java.lang.Object
implements android.os.Parcelable
| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<CalendarDay> |
CREATOR |
| Constructor and Description |
|---|
CalendarDay()
Deprecated.
|
CalendarDay(java.util.Calendar calendar)
Deprecated.
|
CalendarDay(java.util.Date date)
Deprecated.
|
CalendarDay(int year,
int month,
int day)
Deprecated.
|
CalendarDay(android.os.Parcel in) |
| Modifier and Type | Method and Description |
|---|---|
void |
copyTo(java.util.Calendar calendar)
Copy this day's information to the given calendar instance
|
int |
describeContents() |
boolean |
equals(java.lang.Object o) |
static CalendarDay |
from(java.util.Calendar calendar)
Get a new instance set to the specified day
|
static CalendarDay |
from(java.util.Date date)
Get a new instance set to the specified day
|
static CalendarDay |
from(int year,
int month,
int day)
Get a new instance set to the specified day
|
java.util.Calendar |
getCalendar()
Get this day as a Calendar
|
java.util.Date |
getDate()
Get this day as a Date
|
int |
getDay()
Get the day
|
int |
getMonth()
Get the month, represented by values from Calendar
|
int |
getYear()
Get the year
|
int |
hashCode() |
boolean |
isAfter(CalendarDay other)
Determine if this day is after the given instance
|
boolean |
isBefore(CalendarDay other)
Determine if this day is before the given instance
|
boolean |
isInRange(CalendarDay minDate,
CalendarDay maxDate)
Determine if this day is within a specified range
|
static CalendarDay |
today()
Get a new instance set to today
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<CalendarDay> CREATOR
@Deprecated public CalendarDay()
today()@Deprecated public CalendarDay(java.util.Calendar calendar)
calendar - source to pull date information from for this instancefrom(Calendar)@Deprecated
public CalendarDay(int year,
int month,
int day)
year - new instance's yearmonth - new instance's month as defined by Calendarday - new instance's day of monthfrom(Calendar)@Deprecated public CalendarDay(java.util.Date date)
date - source to pull date information from for this instancefrom(Date)public CalendarDay(android.os.Parcel in)
public static CalendarDay today()
public static CalendarDay from(int year, int month, int day)
year - new instance's yearmonth - new instance's month as defined by Calendarday - new instance's day of monthpublic static CalendarDay from(java.util.Calendar calendar)
calendar - Calendar to pull date information from. Passing null will return nullpublic static CalendarDay from(java.util.Date date)
date - Date to pull date information from. Passing null will return null.public int getYear()
public int getMonth()
public int getDay()
public java.util.Date getDate()
public java.util.Calendar getCalendar()
public void copyTo(java.util.Calendar calendar)
calendar - calendar to set date information topublic boolean isInRange(CalendarDay minDate, CalendarDay maxDate)
minDate - the earliest day, may be nullmaxDate - the latest day, may be nullpublic boolean isBefore(CalendarDay other)
other - the other day to testpublic boolean isAfter(CalendarDay other)
other - the other day to testpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel dest,
int flags)
writeToParcel in interface android.os.Parcelable