|
|||||||||
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.
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()
|
|
AtomDate(java.util.Calendar value)
Create an AtomDate using a java.util.Calendar. |
|
AtomDate(java.util.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(java.lang.String value)
Create an AtomDate using the serialized string format (e.g. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
static java.lang.String |
format(java.util.Date d)
Create the serialized string form from a java.util.Date |
java.util.Calendar |
getCalendar()
Returns the value of this Atom Date as a java.util.Calendar |
java.util.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 |
java.lang.String |
getValue()
Return the serialized string form of the Atom date |
static java.util.Date |
parse(java.lang.String date)
Parse the serialized string form into a java.util.Date |
void |
setValue(java.util.Calendar calendar)
Sets the value of the Atom date using java.util.Calendar |
void |
setValue(java.util.Date date)
Sets the value of the Atom date using java.util.Date |
void |
setValue(long timestamp)
Sets the value of the Atom date using the number of milliseconds since January 1, 1970, 00:00:00 GMT |
void |
setValue(java.lang.String value)
Sets the value of the Atom date using the serialized string form |
java.lang.String |
toString()
|
static AtomDate |
valueOf(java.util.Calendar value)
Create a new Atom Date instance from a java.util.Calendar |
static AtomDate |
valueOf(java.util.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(java.lang.String value)
Create a new Atom Date instance from the serialized string form |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AtomDate()
public AtomDate(java.lang.String value)
value
- The serialized date/time valuepublic AtomDate(java.util.Date value)
value
- The java.util.Date valuepublic AtomDate(java.util.Calendar value)
value
- The java.util.Calendar valuepublic AtomDate(long value)
value
- The number of milliseconds since January 1, 1970, 00:00:00 GMTMethod Detail |
---|
public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- The serialized string form of the datepublic void setValue(java.util.Date date)
date
- A java.util.Datepublic void setValue(java.util.Calendar calendar)
calendar
- a java.util.Calendarpublic void setValue(long timestamp)
timestamp
- The number of milliseconds since January 1, 1970, 00:00:00 GMTpublic java.util.Date getDate()
public java.util.Calendar getCalendar()
public long getTime()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static java.util.Date parse(java.lang.String date)
date
- The serialized string form of the date
public static java.lang.String format(java.util.Date d)
d
- A java.util.Date
public static AtomDate valueOf(java.lang.String value)
value
- The serialized string form of the date
public static AtomDate valueOf(java.util.Date value)
value
- a java.util.Date
public static AtomDate valueOf(java.util.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 |