Package com.exedio.cope.util
Class Day
- java.lang.Object
-
- com.exedio.cope.util.Day
-
- All Implemented Interfaces:
Serializable
,Comparable<Day>
public final class Day extends Object implements Serializable, Comparable<Day>
The classDay
represents a specific day. An instance of this class does NOT represent range of time, but rather something like a calendar sheet. If you want to convertDay
intoDate
or vice versa, the result depends on theTimeZone
.Instance of this class are immutable, so you cannot change the value of an instance of this class.
- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Day()
Deprecated.ProvideTimeZone
as parameter.Day(int year, int month, int day)
Day(long date)
Deprecated.ProvideTimeZone
as parameter.Day(long date, TimeZone zone)
Day(Date date)
Deprecated.ProvideTimeZone
as parameter.Day(Date date, TimeZone zone)
Day(GregorianCalendar cal)
Day(TimeZone zone)
Creates a newDay
object, that represents today.Day(XMLGregorianCalendar cal)
-
Method Summary
-
-
-
Constructor Detail
-
Day
public Day(TimeZone zone)
Creates a newDay
object, that represents today.
-
Day
public Day(long date, TimeZone zone)
-
Day
public Day(GregorianCalendar cal)
-
Day
public Day(XMLGregorianCalendar cal)
-
Day
public Day(int year, int month, int day)
-
Day
@Deprecated public Day()
Deprecated.ProvideTimeZone
as parameter.Creates a newDay
object, that represents today.
-
Day
@Deprecated public Day(Date date)
Deprecated.ProvideTimeZone
as parameter.
-
Day
@Deprecated public Day(long date)
Deprecated.ProvideTimeZone
as parameter.
-
-
Method Detail
-
valueOf
public static Day valueOf(GregorianCalendar value)
-
valueOf
public static Day valueOf(XMLGregorianCalendar value)
-
getYear
public int getYear()
-
getMonthValue
public int getMonthValue()
- See Also:
LocalDate.getMonthValue()
-
getDayOfMonth
public int getDayOfMonth()
- See Also:
LocalDate.getDayOfMonth()
-
getTimeInMillisFrom
public long getTimeInMillisFrom(TimeZone zone)
-
getTimeInMillisTo
public long getTimeInMillisTo(TimeZone zone)
-
getGregorianCalendar
public GregorianCalendar getGregorianCalendar(TimeZone zone)
-
getXMLGregorianCalendar
public XMLGregorianCalendar getXMLGregorianCalendar()
-
getXMLGregorianCalendar
public XMLGregorianCalendar getXMLGregorianCalendar(DatatypeFactory factory)
-
plusDays
public Day plusDays(int days)
- See Also:
LocalDate.plusDays(long)
-
isAfter
public boolean isAfter(Day when)
-
isBefore
public boolean isBefore(Day when)
-
compareTo
public int compareTo(Day other)
- Specified by:
compareTo
in interfaceComparable<Day>
-
toLocalDate
public LocalDate toLocalDate()
- See Also:
Date.toInstant()
-
from
public static Day from(LocalDate localDate)
- See Also:
Date.from(java.time.Instant)
-
getMonth
@Deprecated public int getMonth()
Deprecated.UsegetMonthValue()
instead
-
getDay
@Deprecated public int getDay()
Deprecated.UsegetDayOfMonth()
instead
-
add
@Deprecated public Day add(int days)
Deprecated.UseplusDays(int)
instead
-
after
@Deprecated public boolean after(Day when)
Deprecated.UseisAfter(Day)
instead
-
before
@Deprecated public boolean before(Day when)
Deprecated.UseisBefore(Day)
instead
-
valueOf
@Deprecated public static Day valueOf(Date value)
Deprecated.ProvideTimeZone
as parameter.
-
getTimeFrom
@Deprecated public Date getTimeFrom()
Deprecated.ProvideTimeZone
as parameter.
-
getTimeTo
@Deprecated public Date getTimeTo()
Deprecated.ProvideTimeZone
as parameter.
-
getTimeInMillisFrom
@Deprecated public long getTimeInMillisFrom()
Deprecated.ProvideTimeZone
as parameter.
-
getTimeInMillisTo
@Deprecated public long getTimeInMillisTo()
Deprecated.ProvideTimeZone
as parameter.
-
getGregorianCalendar
@Deprecated public GregorianCalendar getGregorianCalendar()
Deprecated.ProvideTimeZone
as parameter.
-
getTimeInMillis
@Deprecated public long getTimeInMillis()
Deprecated.UsegetTimeInMillisFrom()
instead
-
-