Class XSDDateTime

java.lang.Object
org.apache.jena.datatypes.xsd.AbstractDateTime
org.apache.jena.datatypes.xsd.XSDDateTime
All Implemented Interfaces:
Comparable<AbstractDateTime>

public class XSDDateTime extends AbstractDateTime
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

    Fields
    Modifier and Type
    Field
    Description
    static final short
    Mask to indicate whether day is present
    static final short
    Mask to indicate all date/time are present
    static final short
    Mask to indicate whether month is present
    static final short
    Mask to indicate whether time is present
    static final short
    Mask to indicate whether year is present

    Fields inherited from class org.apache.jena.datatypes.xsd.AbstractDateTime

    EQUAL, GREATER_THAN, INDETERMINATE, LESS_THAN
  • Constructor Summary

    Constructors
    Constructor
    Description
    XSDDateTime(Object value, int mask)
    Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.
    Constructor - create a full DateTime object from a java calendar instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the date time as a java Calendar object.
    int
    Return the number of years in the dateTime
    int
    Return the number of full seconds in the dateTime
    int
    Return the number of hours in the dateTime
    int
    Return the number of minutes in the dateTime
    int
    Return the month in the dateTime, this is in ISO8601 format so january = 1
    Return the most specific xsd type which can represent this date/time
    double
    Return the number of seconds in the dateTime, including fractional part
    double
    Return the time component of the dateTime - i.e.
    int
    Return the number of years in the dateTime.
    void
    Set the mask for this date/time to be that appropriate for the given XSD subtype.
    Return the lexical form of the time component.
    Return legal serialized form.

    Methods inherited from class org.apache.jena.datatypes.xsd.AbstractDateTime

    compare, compareTo, equals, hashCode, normalize

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • YEAR_MASK

      public static final short YEAR_MASK
      Mask to indicate whether year is present
      See Also:
    • MONTH_MASK

      public static final short MONTH_MASK
      Mask to indicate whether month is present
      See Also:
    • DAY_MASK

      public static final short DAY_MASK
      Mask to indicate whether day is present
      See Also:
    • TIME_MASK

      public static final short TIME_MASK
      Mask to indicate whether time is present
      See Also:
    • FULL_MASK

      public static final short FULL_MASK
      Mask to indicate all date/time are present
      See Also:
  • Constructor Details

    • XSDDateTime

      public XSDDateTime(Object value, int mask)
      Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.
      Parameters:
      value - the date/time value returned by the parsing
      mask - bitmask defining which components are valid in this instance (e.g. dates don't have valid time fields).
    • XSDDateTime

      public XSDDateTime(Calendar date)
      Constructor - create a full DateTime object from a java calendar instance.
      Parameters:
      date - java calendar instance
  • Method Details