Representation for W3C XML Schema 1.0 date/time datatypes. Specifically, these date/time datatypes are dateTime, time, date, gYearMonth, gMonthDay, gYear gMonth and gDay defined in the XML Namespace "http://www.w3.org/2001/XMLSchema". These datatypes are normatively defined in W3C XML Schema 1.0 Part 2, Section 3.2.7-14.

The table below defines the mapping between XML Schema 1.0 date/time datatype fields and this class' fields. It also summarizes the value constraints for the date and time fields defined in W3C XML Schema 1.0 Part 2, Appendix D, ISO 8601 Date and Time Formats.

Date/Time Datatype Field Mapping Between XML Schema 1.0 and Java Representation
XML Schema 1.0
datatype
field
Related
XMLGregorianCalendar
Accessor(s)
Value Range
year + or
#getEonAndYear
getYear() is a value between -(10^9-1) to (10^9)-1 or DatatypeConstants#FIELD_UNDEFINED .
#getEon() is high order year value in billion of years.
getEon() has values greater than or equal to (10^9) or less than or equal to -(10^9). A value of null indicates field is undefined.
Given that XML Schema 1.0 errata states that the year zero will be a valid lexical value in a future version of XML Schema, this class allows the year field to be set to zero. Otherwise, the year field value is handled exactly as described in the errata and [ISO-8601-1988]. Note that W3C XML Schema 1.0 validation does not allow for the year field to have a value of zero.
month #getMonth() 1 to 12 or DatatypeConstants#FIELD_UNDEFINED
day #getDay() Independent of month, max range is 1 to 31 or DatatypeConstants#FIELD_UNDEFINED .
The normative value constraint stated relative to month field's value is in W3C XML Schema 1.0 Part 2, Appendix D.
hour #getHour() 0 to 24 or DatatypeConstants#FIELD_UNDEFINED . For a value of 24, the minute and second field must be zero per XML Schema Errata.
minute #getMinute() 0 to 59 or DatatypeConstants#FIELD_UNDEFINED
second #getSecond() + #getMillisecond() /1000 or
#getSecond() + #getFractionalSecond()
#getSecond() from 0 to 60 or DatatypeConstants#FIELD_UNDEFINED .
(Note: 60 only allowable for leap second.)
#getFractionalSecond() allows for infinite precision over the range from 0.0 to 1.0 when the #getSecond() is defined.
FractionalSecond is optional and has a value of null when it is undefined.
#getMillisecond() is the convenience millisecond precision of value of #getFractionalSecond() .
timezone #getTimezone() Number of minutes or DatatypeConstants#FIELD_UNDEFINED . Value range from -14 hours (-14 * 60 minutes) to 14 hours (14 * 60 minutes).

All maximum value space constraints listed for the fields in the table above are checked by factory methods, @{link DatatypeFactory}, setter methods and parse methods of this class. IllegalArgumentException is thrown when a parameter's value is outside the value constraint for the field or if the composite values constitute an invalid XMLGregorianCalendar instance (for example, if the 31st of June is specified).

The following operations are defined for this class:

@version
$Revision: 1.28.4.2.2.4.2.1.2.2.2.6 $, $Date: 2004/06/09 19:06:01 $
@since
1.5

Add duration to this instance.

The computation is specified in XML Schema 1.0 Part 2, Appendix E, Adding durations to dateTimes>. date/time field mapping table defines the mapping from XML Schema 1.0 dateTime fields to this class' representation of those fields.

Parameters
durationDuration to add to this XMLGregorianCalendar.
Throws
NullPointerExceptionwhen duration parameter is null.

Unset all fields to undefined.

Set all int fields to DatatypeConstants#FIELD_UNDEFINED and reference fields to null.

Creates and returns a copy of this object.

Return
copy of this Object

Compare two instances of W3C XML Schema 1.0 date/time datatypes according to partial order relation defined in W3C XML Schema 1.0 Part 2, Section 3.2.7.3, Order relation on dateTime.

xsd:dateTime datatype field mapping to accessors of this class are defined in date/time field mapping table.

Parameters
xmlGregorianCalendarInstance of XMLGregorianCalendar to compare
Return
The relationship between this XMLGregorianCalendar and the specified xmlGregorianCalendar as {@link DatatypeConstants#LESSER}, {@link DatatypeConstants#EQUAL}, {@link DatatypeConstants#GREATER} or {@link DatatypeConstants#INDETERMINATE}.
Throws
NullPointerExceptionif xmlGregorianCalendar is null.

Indicates whether parameter obj is "equal to" this one.

Parameters
objto compare.
Return
true when obj is an instance of XMLGregorianCalendar and {@link #compare(XMLGregorianCalendar obj)} returns {@link DatatypeConstants#EQUAL}, otherwise false.
Throws
NullPointerExceptionIf obj is null.
Returns the runtime class of an object. That Class object is the object that is locked by static synchronized methods of the represented class.
Return
The java.lang.Class object that represents the runtime class of the object. The result is of type {@code Class} where X is the erasure of the static type of the expression on which getClass is called.
Return day in month or DatatypeConstants#FIELD_UNDEFINED .

Value constraints for this value are summarized in day field of date/time field mapping table.

See Also

Return high order component for XML Schema 1.0 dateTime datatype field for year. null if this optional part of the year field is not defined.

Value constraints for this value are summarized in year field of date/time field mapping table.

Return
eon of this XMLGregorianCalendar. The value returned is an integer multiple of 10^9.

Return XML Schema 1.0 dateTime datatype field for year.

Value constraints for this value are summarized in year field of date/time field mapping table.

Return
sum of eon and BigInteger.valueOf(year) when both fields are defined. When only year is defined, return it. When both eon and year are not defined, return null.

Return fractional seconds.

null is returned when this optional field is not defined.

Value constraints are detailed in second field of date/time field mapping table.

This optional field can only have a defined value when the xs:dateTime second field, represented by , does not return DatatypeConstants#FIELD_UNDEFINED .

Return
fractional seconds of this XMLGregorianCalendar.
Return hours or DatatypeConstants#FIELD_UNDEFINED . Returns DatatypeConstants#FIELD_UNDEFINED if this field is not defined.

Value constraints for this value are summarized in hour field of date/time field mapping table.

Return millisecond precision of .

This method represents a convenience accessor to infinite precision fractional second value returned by . The returned value is the rounded down to milliseconds value of . When returns null, this method must return DatatypeConstants#FIELD_UNDEFINED .

Value constraints for this value are summarized in second field of date/time field mapping table.

Return
Millisecond of this XMLGregorianCalendar.
Return minutes or DatatypeConstants#FIELD_UNDEFINED .

Returns DatatypeConstants#FIELD_UNDEFINED if this field is not defined.

Value constraints for this value are summarized in minute field of date/time field mapping table.

Return number of month or DatatypeConstants#FIELD_UNDEFINED .

Value constraints for this value are summarized in month field of date/time field mapping table.

Return
year of this XMLGregorianCalendar.

Return seconds or DatatypeConstants#FIELD_UNDEFINED .

Returns DatatypeConstants#FIELD_UNDEFINED if this field is not defined. When this field is not defined, the optional xs:dateTime fractional seconds field, represented by and , must not be defined.

Value constraints for this value are summarized in second field of date/time field mapping table.

Return
Second of this XMLGregorianCalendar.
Return timezone offset in minutes or DatatypeConstants#FIELD_UNDEFINED if this optional field is not defined.

Value constraints for this value are summarized in timezone field of date/time field mapping table.

Returns a java.util.TimeZone for this class.

If timezone field is defined for this instance, returns TimeZone initialized with custom timezone id of zoneoffset. If timezone field is undefined, try the defaultZoneoffset that was passed in. If defaultZoneoffset is FIELD_UNDEFINED, return default timezone for this host. (Same default as java.util.GregorianCalendar).

Parameters
defaultZoneoffsetdefault zoneoffset if this zoneoffset is {@link DatatypeConstants#FIELD_UNDEFINED}.
Return
TimeZone for this.

Return the name of the XML Schema date/time type that this instance maps to. Type is computed based on fields that are set.

Required fields for XML Schema 1.0 Date/Time Datatypes.
(timezone is optional for all date/time datatypes)
Datatype year month day hour minute second
DatatypeConstants#DATETIME X X X X X X
DatatypeConstants#DATE X X X
DatatypeConstants#TIME X X X
DatatypeConstants#GYEARMONTH X X
DatatypeConstants#GMONTHDAY X X
DatatypeConstants#GYEAR X
DatatypeConstants#GMONTH X
DatatypeConstants#GDAY X
Return
One of the following class constants: {@link DatatypeConstants#DATETIME}, {@link DatatypeConstants#TIME}, {@link DatatypeConstants#DATE}, {@link DatatypeConstants#GYEARMONTH}, {@link DatatypeConstants#GMONTHDAY}, {@link DatatypeConstants#GYEAR}, {@link DatatypeConstants#GMONTH} or {@link DatatypeConstants#GDAY}.
Throws
java.lang.IllegalStateExceptionif the combination of set fields does not match one of the eight defined XML Schema builtin date/time datatypes.

Return low order component for XML Schema 1.0 dateTime datatype field for year or DatatypeConstants#FIELD_UNDEFINED .

Value constraints for this value are summarized in year field of date/time field mapping table.

Return
year of this XMLGregorianCalendar.

Returns a hash code consistent with the definition of the equals method.

Return
hash code of this object.
Validate instance by getXMLSchemaType() constraints.
Return
true if data values are valid.

Normalize this instance to UTC.

2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z

Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).

Return
this XMLGregorianCalendar normalized to UTC.
Wakes up a single thread that is waiting on this object's monitor. If any threads are waiting on this object, one of them is chosen to be awakened. The choice is arbitrary and occurs at the discretion of the implementation. A thread waits on an object's monitor by calling one of the wait methods.

The awakened thread will not be able to proceed until the current thread relinquishes the lock on this object. The awakened thread will compete in the usual manner with any other threads that might be actively competing to synchronize on this object; for example, the awakened thread enjoys no reliable privilege or disadvantage in being the next thread to lock this object.

This method should only be called by a thread that is the owner of this object's monitor. A thread becomes the owner of the object's monitor in one of three ways:

  • By executing a synchronized instance method of that object.
  • By executing the body of a synchronized statement that synchronizes on the object.
  • For objects of type Class, by executing a synchronized static method of that class.

Only one thread at a time can own an object's monitor.

Throws
IllegalMonitorStateExceptionif the current thread is not the owner of this object's monitor.
Wakes up all threads that are waiting on this object's monitor. A thread waits on an object's monitor by calling one of the wait methods.

The awakened threads will not be able to proceed until the current thread relinquishes the lock on this object. The awakened threads will compete in the usual manner with any other threads that might be actively competing to synchronize on this object; for example, the awakened threads enjoy no reliable privilege or disadvantage in being the next thread to lock this object.

This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.

Throws
IllegalMonitorStateExceptionif the current thread is not the owner of this object's monitor.

Reset this XMLGregorianCalendar to its original values.

XMLGregorianCalendar is reset to the same values as when it was created with , , , , , , , or .

reset() is designed to allow the reuse of existing XMLGregorianCalendars thus saving resources associated with the creation of new XMLGregorianCalendars.

Set days in month.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
dayvalue constraints summarized in day field of date/time field mapping table.
Throws
IllegalArgumentExceptionif day parameter is outside value constraints for the field as specified in date/time field mapping table.

Set fractional seconds.

Unset this field by invoking the setter with a parameter value of null.

Parameters
fractionalvalue constraints summarized in fractional field of date/time field mapping table.
Throws
IllegalArgumentExceptionif fractional parameter is outside value constraints for the field as specified in date/time field mapping table.

Set hours.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
hourvalue constraints summarized in hour field of date/time field mapping table.
Throws
IllegalArgumentExceptionif hour parameter is outside value constraints for the field as specified in date/time field mapping table.

Set milliseconds.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
millisecondvalue constraints summarized in millisecond field of date/time field mapping table.
Throws
IllegalArgumentExceptionif millisecond parameter is outside value constraints for the field as specified in date/time field mapping table.

Set minutes.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
minutevalue constraints summarized in minute field of date/time field mapping table.
Throws
IllegalArgumentExceptionif minute parameter is outside value constraints for the field as specified in date/time field mapping table.

Set month.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
monthvalue constraints summarized in month field of date/time field mapping table.
Throws
IllegalArgumentExceptionif month parameter is outside value constraints for the field as specified in date/time field mapping table.

Set seconds.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
secondvalue constraints summarized in second field of date/time field mapping table.
Throws
IllegalArgumentExceptionif second parameter is outside value constraints for the field as specified in date/time field mapping table.

Set time as one unit.

Parameters
hourvalue constraints are summarized in hour field of date/time field mapping table.
minutevalue constraints are summarized in minute field of date/time field mapping table.
secondvalue constraints are summarized in second field of date/time field mapping table.
Throws
IllegalArgumentExceptionif any parameter is outside value constraints for the field as specified in date/time field mapping table.

Set time as one unit, including the optional infinite precision fractional seconds.

Parameters
hourvalue constraints are summarized in hour field of date/time field mapping table.
minutevalue constraints are summarized in minute field of date/time field mapping table.
secondvalue constraints are summarized in second field of date/time field mapping table.
fractionalvalue of null indicates this optional field is not set.
Throws
IllegalArgumentExceptionif any parameter is outside value constraints for the field as specified in date/time field mapping table.

Set time as one unit, including optional milliseconds.

Parameters
hourvalue constraints are summarized in hour field of date/time field mapping table.
minutevalue constraints are summarized in minute field of date/time field mapping table.
secondvalue constraints are summarized in second field of date/time field mapping table.
millisecondvalue of {@link DatatypeConstants#FIELD_UNDEFINED} indicates this optional field is not set.
Throws
IllegalArgumentExceptionif any parameter is outside value constraints for the field as specified in date/time field mapping table.

Set the number of minutes in the timezone offset.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Parameters
offsetvalue constraints summarized in timezone field of date/time field mapping table.
Throws
IllegalArgumentExceptionif offset parameter is outside value constraints for the field as specified in date/time field mapping table.

Set low and high order component of XSD dateTime year field.

Unset this field by invoking the setter with a parameter value of null.

Parameters
yearvalue constraints summarized in year field of date/time field mapping table.
Throws
IllegalArgumentExceptionif year parameter is outside value constraints for the field as specified in date/time field mapping table.

Set year of XSD dateTime year field.

Unset this field by invoking the setter with a parameter value of DatatypeConstants#FIELD_UNDEFINED .

Note: if the absolute value of the year parameter is less than 10^9, the eon component of the XSD year field is set to null by this method.

Parameters
yearvalue constraints are summarized in year field of date/time field mapping table. If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to null.

Convert this XMLGregorianCalendar to a GregorianCalendar .

When this instance has an undefined field, this conversion relies on the java.util.GregorianCalendar default for its corresponding field. A notable difference between XML Schema 1.0 date/time datatypes and java.util.GregorianCalendar is that Timezone value is optional for date/time datatypes and it is a required field for java.util.GregorianCalendar. See javadoc for java.util.TimeZone.getDefault() on how the default is determined. To explicitly specify the TimeZone instance, see .

Field by Field Conversion from this class to java.util.GregorianCalendar
java.util.GregorianCalendar field javax.xml.datatype.XMLGregorianCalendar field
ERA .signum() < 0 ? GregorianCalendar.BC : GregorianCalendar.AD
YEAR .abs().intValue()*
MONTH - DatatypeConstants#JANUARY + GregorianCalendar#JANUARY
DAY_OF_MONTH #getDay()
HOUR_OF_DAY #getHour()
MINUTE #getMinute()
SECOND #getSecond()
MILLISECOND get millisecond order from #getFractionalSecond() *
GregorianCalendar.setTimeZone(TimeZone) #getTimezone() formatted into Custom timezone id
* designates possible loss of precision during the conversion due to source datatype having higher precision than target datatype.

To ensure consistency in conversion implementations, the new GregorianCalendar should be instantiated in following manner.

  • Using timeZone value as defined above, create a new java.util.GregorianCalendar(timeZone,Locale.getDefault()).
  • Initialize all GregorianCalendar fields by calling {(@link GegorianCalendar#clear()}.
  • Obtain a pure Gregorian Calendar by invoking GregorianCalendar.setGregorianChange( new Date(Long.MIN_VALUE)).
  • Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE, SECOND and MILLISECOND are set using the method Calendar.set(int,int)

Convert this XMLGregorianCalendar along with provided parameters to a GregorianCalendar instance.

Since XML Schema 1.0 date/time datetypes has no concept of timezone ids or daylight savings timezone ids, this conversion operation allows the user to explicitly specify one with timezone parameter.

To compute the return value's TimeZone field,

  • when parameter timeZone is non-null, it is the timezone field.
  • else when this.getTimezone() != FIELD_UNDEFINED, create a java.util.TimeZone with a custom timezone id using the this.getTimezone().
  • else when defaults.getTimezone() != FIELD_UNDEFINED, create a java.util.TimeZone with a custom timezone id using defaults.getTimezone().
  • else use the GregorianCalendar default timezone value for the host is defined as specified by java.util.TimeZone.getDefault().
  • To ensure consistency in conversion implementations, the new GregorianCalendar should be instantiated in following manner.

    • Create a new java.util.GregorianCalendar(TimeZone, Locale) with TimeZone set as specified above and the Locale parameter.
    • Initialize all GregorianCalendar fields by calling
    • Obtain a pure Gregorian Calendar by invoking GregorianCalendar.setGregorianChange( new Date(Long.MIN_VALUE)).
    • Its fields ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE, SECOND and MILLISECOND are set using the method Calendar.set(int,int)
Parameters
timezoneprovide Timezone. null is a legal value.
aLocaleprovide explicit Locale. Use default GregorianCalendar locale if value is null.
defaultsprovide default field values to use when corresponding field for this instance is FIELD_UNDEFINED or null. If defaultsis null or a field within the specified defaults is undefined, just use java.util.GregorianCalendar defaults.
Return
a java.util.GregorianCalendar conversion of this instance.

Returns a String representation of this XMLGregorianCalendar Object.

The result is a lexical representation generated by .

Return
A non-null valid String representation of this XMLGregorianCalendar.
Throws
IllegalStateExceptionif the combination of set fields does not match one of the eight defined XML Schema builtin date/time datatypes.

Return the lexical representation of this instance. The format is specified in XML Schema 1.0 Part 2, Section 3.2.[7-14].1, Lexical Representation".

Specific target lexical representation format is determined by .

Return
XML, as String, representation of this XMLGregorianCalendar
Throws
IllegalStateExceptionif the combination of set fields does not match one of the eight defined XML Schema builtin date/time datatypes.
Causes current thread to wait until another thread invokes the method or the method for this object. In other words, this method behaves exactly as if it simply performs the call wait(0).

The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method. The thread then waits until it can re-obtain ownership of the monitor and resumes execution.

As in the one argument version, interrupts and spurious wakeups are possible, and this method should always be used in a loop:

     synchronized (obj) {
         while (<condition does not hold>)
             obj.wait();
         ... // Perform action appropriate to condition
     }
 
This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.
Throws
IllegalMonitorStateExceptionif the current thread is not the owner of the object's monitor.
InterruptedExceptionif another thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.
Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.

The current thread must own this object's monitor.

This method causes the current thread (call it T) to place itself in the wait set for this object and then to relinquish any and all synchronization claims on this object. Thread T becomes disabled for thread scheduling purposes and lies dormant until one of four things happens:

  • Some other thread invokes the notify method for this object and thread T happens to be arbitrarily chosen as the thread to be awakened.
  • Some other thread invokes the notifyAll method for this object.
  • Some other thread interrupts thread T.
  • The specified amount of real time has elapsed, more or less. If timeout is zero, however, then real time is not taken into consideration and the thread simply waits until notified.
The thread T is then removed from the wait set for this object and re-enabled for thread scheduling. It then competes in the usual manner with other threads for the right to synchronize on the object; once it has gained control of the object, all its synchronization claims on the object are restored to the status quo ante - that is, to the situation as of the time that the wait method was invoked. Thread T then returns from the invocation of the wait method. Thus, on return from the wait method, the synchronization state of the object and of thread T is exactly as it was when the wait method was invoked.

A thread can also wake up without being notified, interrupted, or timing out, a so-called spurious wakeup. While this will rarely occur in practice, applications must guard against it by testing for the condition that should have caused the thread to be awakened, and continuing to wait if the condition is not satisfied. In other words, waits should always occur in loops, like this one:

     synchronized (obj) {
         while (<condition does not hold>)
             obj.wait(timeout);
         ... // Perform action appropriate to condition
     }
 
(For more information on this topic, see Section 3.2.3 in Doug Lea's "Concurrent Programming in Java (Second Edition)" (Addison-Wesley, 2000), or Item 50 in Joshua Bloch's "Effective Java Programming Language Guide" (Addison-Wesley, 2001).

If the current thread is interrupted by another thread while it is waiting, then an InterruptedException is thrown. This exception is not thrown until the lock status of this object has been restored as described above.

Note that the wait method, as it places the current thread into the wait set for this object, unlocks only this object; any other objects on which the current thread may be synchronized remain locked while the thread waits.

This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.

Parameters
timeoutthe maximum time to wait in milliseconds.
Throws
IllegalArgumentExceptionif the value of timeout is negative.
IllegalMonitorStateExceptionif the current thread is not the owner of the object's monitor.
InterruptedExceptionif another thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.
Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

This method is similar to the wait method of one argument, but it allows finer control over the amount of time to wait for a notification before giving up. The amount of real time, measured in nanoseconds, is given by:

 1000000*timeout+nanos

In all other respects, this method does the same thing as the method of one argument. In particular, wait(0, 0) means the same thing as wait(0).

The current thread must own this object's monitor. The thread releases ownership of this monitor and waits until either of the following two conditions has occurred:

  • Another thread notifies threads waiting on this object's monitor to wake up either through a call to the notify method or the notifyAll method.
  • The timeout period, specified by timeout milliseconds plus nanos nanoseconds arguments, has elapsed.

The thread then waits until it can re-obtain ownership of the monitor and resumes execution.

As in the one argument version, interrupts and spurious wakeups are possible, and this method should always be used in a loop:

     synchronized (obj) {
         while (<condition does not hold>)
             obj.wait(timeout, nanos);
         ... // Perform action appropriate to condition
     }
 
This method should only be called by a thread that is the owner of this object's monitor. See the notify method for a description of the ways in which a thread can become the owner of a monitor.
Parameters
timeoutthe maximum time to wait in milliseconds.
nanosadditional time, in nanoseconds range 0-999999.
Throws
IllegalArgumentExceptionif the value of timeout is negative or the value of nanos is not in the range 0-999999.
IllegalMonitorStateExceptionif the current thread is not the owner of this object's monitor.
InterruptedExceptionif another thread interrupted the current thread before or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown.