|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hp.hpl.jena.datatypes.xsd.AbstractDateTime
com.hp.hpl.jena.datatypes.xsd.XSDDateTime
public class XSDDateTime
Represent an XSD date/time value. Rather than have a separate type for each legal date/time value combination this is a combination type than does runtime checks whether a given field is legal in the current circumstances.
| Field Summary | |
|---|---|
static short |
DAY_MASK
Mask to indicate whether day is present |
static short |
FULL_MASK
Mask to indicate all date/time are present |
static short |
MONTH_MASK
Mask to indicate whether month is present |
static short |
TIME_MASK
Mask to indicate whether time is present |
static short |
YEAR_MASK
Mask to indicate whether year is present |
| Fields inherited from class com.hp.hpl.jena.datatypes.xsd.AbstractDateTime |
|---|
EQUAL, GREATER_THAN, INDETERMINATE, LESS_THAN |
| Constructor Summary | |
|---|---|
XSDDateTime(Calendar date)
Constructor - create a full DateTime object from a java calendar instance. |
|
XSDDateTime(Object value,
int mask)
Constructor - should only be used by the internals but public scope because the internals spread across multiple packages. |
|
| Method Summary | |
|---|---|
Calendar |
asCalendar()
Return the date time as a java Calendar object. |
int |
getDays()
Return the number of years in the dateTime |
int |
getFullSeconds()
Return the number of full seconds in the dateTime |
int |
getHours()
Return the number of hours in the dateTime |
int |
getMinutes()
Return the number of minutes in the dateTime |
int |
getMonths()
Return the month in the dateTime, this is in ISO8601 format so january = 1 |
XSDDatatype |
getNarrowedDatatype()
Return the most specific xsd type which can represent this date/time |
double |
getSeconds()
Return the number of seconds in the dateTime, including fractional part |
double |
getTimePart()
Return the time component of the dateTime - i.e. |
int |
getYears()
Return the number of years in the dateTime. |
void |
narrowType(XSDDatatype dt)
Set the mask for this date/time to be that appropriate for the given XSD subtype. |
String |
timeLexicalForm()
Return the lexical form of the time component. |
String |
toString()
Return legal serialized form. |
| Methods inherited from class com.hp.hpl.jena.datatypes.xsd.AbstractDateTime |
|---|
compare, compareTo, equals, hashCode, normalize |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final short YEAR_MASK
public static final short MONTH_MASK
public static final short DAY_MASK
public static final short TIME_MASK
public static final short FULL_MASK
| Constructor Detail |
|---|
public XSDDateTime(Object value,
int mask)
value - the date/time value returned by the parsingmask - bitmask defining which components are valid in this instance
(e.g. dates don't have valid time fields).public XSDDateTime(Calendar date)
date - java calendar instance| Method Detail |
|---|
public XSDDatatype getNarrowedDatatype()
public void narrowType(XSDDatatype dt)
public Calendar asCalendar()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if this is not a full date + time
public int getYears()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal year component
public int getMonths()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal month component
public int getDays()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal day component
public int getHours()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal time component
public int getMinutes()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal time component
public int getFullSeconds()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal time component
public double getSeconds()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal time component
public double getTimePart()
throws IllegalDateTimeFieldException
IllegalDateTimeFieldException - if there is no legal time componentpublic String toString()
toString in class Objectpublic String timeLexicalForm()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||