org.eclipse.rdf4j.model.datatypes

## Class XMLDateTime

- java.lang.Object
- - org.eclipse.rdf4j.model.datatypes.XMLDateTime

- All Implemented Interfaces:
    Cloneable, Comparable<XMLDateTime>

      public 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 Definition Language (XSD) 1.1 Part 2: Datatypes.

  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.
  Author:
    Arjohn Kampman, Jeen Broekstra
  See Also:
    W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()`
    `int` | `compareTo(XMLDateTime otherDT)` 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 Detail

    - #### XMLDateTime

          public XMLDateTime(String dateTimeString)

      Creates a new XMLDateTime object for the supplied xsd:dateTime string value.
      Parameters:
        `dateTimeString` - An xsd:dateTime lexical value, for example `1999-05-31T13:20:00-05:00`.
      Throws:
        `IllegalArgumentException` - if the supplied lexical value does not constitute a valid xsd:dateTime.

  - ### Method Detail

    - #### 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(XMLDateTime otherDT)

      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`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.