Package com.stardog.stark

# Class XMLDateTime

java.lang.Object
com.stardog.stark.XMLDateTime

All Implemented Interfaces:
  `Cloneable`, `Comparable<XMLDateTime>`

public final class XMLDateTime extends Object implements Cloneable, Comparable<XMLDateTime>
This class provides utility functions for comparisons operating on `xml:dateTime` datatypes as specified in W3C, XML Schema Part 2: Datatypes Second Edition Known deviations from the standard: - the range of years in this implementation is limited to Integer.MIN_VALUE to Integer.MAX_VALUE for practical reasons - this implementation accepts some dates that have impossible month, day-of-month combinations (such as 2005-02-29, which was not a leap year)

Since:
  1.0
Version:
  1.0
Author:
  Arjohn Kampman, Michael Grove

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XMLDateTime(String theDateTime)`
  Creates a new DateTime object for the supplied xsd:dateTime string value.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `int`
  `compareTo(XMLDateTime theDateTime)`
  Compares this DateTime object to another DateTime object.
  `boolean`
  `isNormalized()`
  Checks whether this object has already been normalized.
  `void`
  `normalize()`
  Normalizes this dateTime object.
  `String`
  `toString()`
  Returns the xsd:dateTime string-representation of this object.

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### XMLDateTime

    public XMLDateTime(@Nonnull String theDateTime)
    Creates a new DateTime object for the supplied xsd:dateTime string value.
    Parameters:
      `theDateTime` - An xsd:dateTime value, for example `1999-05-31T13:20:00-05:00`.

- ## Method Details

  - ### isNormalized

    public boolean isNormalized()
    Checks whether this object has already been normalized.

  - ### normalize

    public void normalize()
    Normalizes this dateTime object.

  - ### toString

    public String toString()
    Returns the xsd:dateTime string-representation of this object.
    Overrides:
      `toString` in class `Object`
    Returns:
      An xsd:dateTime value, e.g. `1999-05-31T13:20:00-05:00`.

  - ### compareTo

    public int compareTo(@Nonnull XMLDateTime theDateTime)
    Compares this DateTime object to another DateTime object.
    Specified by:
      `compareTo` in interface `Comparable<XMLDateTime>`
    Throws:
      `ClassCastException` - If `other` is not a DateTime object.

  - ### clone

    public Object clone()
    Overrides:
      `clone` in class `Object`