|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.abdera.model.AtomDate
public final class AtomDate
Provides an implementation of the Atom Date Construct, which is itself a specialization of the RFC3339 date-time.
Accessors on this class are not synchronized.
Per RFC4287:
3.3. Date Constructs A Date construct is an element whose content MUST conform to the "date-time" production in [RFC3339]. In addition, an uppercase "T" character MUST be used to separate date and time, and an uppercase "Z" character MUST be present in the absence of a numeric time zone offset. atomDateConstruct = atomCommonAttributes, xsd:dateTime Such date values happen to be compatible with the following specifications: [ISO.8601.1988], [W3C.NOTE-datetime-19980827], and [W3C.REC-xmlschema-2-20041028]. Example Date constructs: <updated>2003-12-13T18:30:02Z</updated> <updated>2003-12-13T18:30:02.25Z</updated> <updated>2003-12-13T18:30:02+01:00</updated> <updated>2003-12-13T18:30:02.25+01:00</updated> Date values SHOULD be as accurate as possible. For example, it would be generally inappropriate for a publishing system to apply the same timestamp to several entries that were published during the course of a single day.
Constructor Summary | |
---|---|
AtomDate()
Create an AtomDate using the current date and time |
|
AtomDate(Calendar value)
Create an AtomDate using a java.util.Calendar. |
|
AtomDate(Date value)
Create an AtomDate using a java.util.Date |
|
AtomDate(long value)
Create an AtomDate using the number of milliseconds since January 1, 1970, 00:00:00 GMT |
|
AtomDate(String value)
Create an AtomDate using the serialized string format (e.g. 2003-12-13T18:30:02Z). |
Method Summary | |
---|---|
Object |
clone()
|
boolean |
equals(Object obj)
|
static String |
format(Date date)
Create the serialized string form from a java.util.Date |
Calendar |
getCalendar()
Returns the value of this Atom Date as a java.util.Calendar |
Date |
getDate()
Returns the value of this Atom Date |
long |
getTime()
Returns the value of this Atom Date as the number of milliseconds since January 1, 1970, 00:00:00 GMT |
String |
getValue()
Return the serialized string form of the Atom date |
int |
hashCode()
|
static Date |
parse(String date)
Parse the serialized string form into a java.util.Date |
AtomDate |
setValue(Calendar calendar)
Sets the value of the Atom date using java.util.Calendar |
AtomDate |
setValue(Date date)
Sets the value of the Atom date using java.util.Date |
AtomDate |
setValue(long timestamp)
Sets the value of the Atom date using the number of milliseconds since January 1, 1970, 00:00:00 GMT |
AtomDate |
setValue(String value)
Sets the value of the Atom date using the serialized string form |
String |
toString()
|
static AtomDate |
valueOf(Calendar value)
Create a new Atom Date instance from a java.util.Calendar |
static AtomDate |
valueOf(Date value)
Create a new Atom Date instance from a java.util.Date |
static AtomDate |
valueOf(long value)
Create a new Atom Date instance using the number of milliseconds since January 1, 1970, 00:00:00 GMT |
static AtomDate |
valueOf(String value)
Create a new Atom Date instance from the serialized string form |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AtomDate()
public AtomDate(String value)
value
- The serialized RFC3339 date/time valuepublic AtomDate(Date value)
value
- The java.util.Date value
NullPointerException
- if date
is null
public AtomDate(Calendar value)
value
- The java.util.Calendar value
NullPointerException
- if value
is null
public AtomDate(long value)
value
- The number of milliseconds since January 1, 1970, 00:00:00 GMTMethod Detail |
---|
public String getValue()
public AtomDate setValue(String value)
value
- The serialized string form of the datepublic AtomDate setValue(Date date)
date
- A java.util.Date
NullPointerException
- if date
is null
public AtomDate setValue(Calendar calendar)
calendar
- a java.util.Calendarpublic AtomDate setValue(long timestamp)
timestamp
- The number of milliseconds since January 1, 1970, 00:00:00 GMTpublic Date getDate()
public Calendar getCalendar()
public long getTime()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public Object clone()
clone
in class Object
public static Date parse(String date)
date
- The serialized string form of the date
public static String format(Date date)
d
- A java.util.Date
public static AtomDate valueOf(String value)
value
- The serialized string form of the date
public static AtomDate valueOf(Date value)
value
- a java.util.Date
public static AtomDate valueOf(Calendar value)
value
- A java.util.Calendar
public static AtomDate valueOf(long value)
value
- The number of milliseconds since January 1, 1970, 00:00:00 GMT
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |