gpt4 book ai didi

com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl.normalizeToTimezone()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 23:01:05 25 4
gpt4 key购买 nike

本文整理了Java中com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl.normalizeToTimezone()方法的一些代码示例,展示了XMLGregorianCalendarImpl.normalizeToTimezone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLGregorianCalendarImpl.normalizeToTimezone()方法的具体详情如下:
包路径:com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl
类名称:XMLGregorianCalendarImpl
方法名:normalizeToTimezone

XMLGregorianCalendarImpl.normalizeToTimezone介绍

[英]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).
[中]将此实例标准化为UTC。
2000-03-04T23:00:00+03:00标准化为2000-03-04T20:00:00Z
实现W3C XML模式第2部分第3.2.7.3(A)节。

代码示例

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * <p>Normalize this instance to UTC.</p>
 *
 * <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z</p>
 * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p>
 */
public XMLGregorianCalendar normalize() {
  XMLGregorianCalendar normalized = normalizeToTimezone(timezone);
  // if timezone was undefined, leave it undefined
  if (getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    normalized.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
  }
  // if milliseconds was undefined, leave it undefined
  if (getMillisecond() == DatatypeConstants.FIELD_UNDEFINED) {
    normalized.setMillisecond(DatatypeConstants.FIELD_UNDEFINED);
  }
  return normalized;
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * <p>Normalize this instance to UTC.</p>
 *
 * <p>2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z</p>
 * <p>Implements W3C XML Schema Part 2, Section 3.2.7.3 (A).</p>
 */
public XMLGregorianCalendar normalize() {
  XMLGregorianCalendar normalized = normalizeToTimezone(timezone);
  // if timezone was undefined, leave it undefined
  if (getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    normalized.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
  }
  // if milliseconds was undefined, leave it undefined
  if (getMillisecond() == DatatypeConstants.FIELD_UNDEFINED) {
    normalized.setMillisecond(DatatypeConstants.FIELD_UNDEFINED);
  }
  return normalized;
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

XMLGregorianCalendar MinQ = Q.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET);
result = internalCompare(P, MinQ);
if (result == DatatypeConstants.LESSER) {
XMLGregorianCalendar MaxQ = Q.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET);
result = internalCompare(P, MaxQ);
if (result == DatatypeConstants.GREATER) {
  Q = (XMLGregorianCalendarImpl) Q.normalizeToTimezone(Q.getTimezone());
XMLGregorianCalendar MaxP = P.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET);
result = internalCompare(MaxP, Q);
if (result == DatatypeConstants.LESSER) {
XMLGregorianCalendar MinP = P.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET);
result = internalCompare(MinP, Q);
if (result == DatatypeConstants.GREATER) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

XMLGregorianCalendar MinQ = Q.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET);
result = internalCompare(P, MinQ);
if (result == DatatypeConstants.LESSER) {
XMLGregorianCalendar MaxQ = Q.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET);
result = internalCompare(P, MaxQ);
if (result == DatatypeConstants.GREATER) {
  Q = (XMLGregorianCalendarImpl) Q.normalizeToTimezone(Q.getTimezone());
XMLGregorianCalendar MaxP = P.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET);
result = internalCompare(MaxP, Q);
if (result == DatatypeConstants.LESSER) {
XMLGregorianCalendar MinP = P.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET);
result = internalCompare(MinP, Q);
if (result == DatatypeConstants.GREATER) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 * <p>Returns a hash code consistent with the definition of the equals method.</p>
 *
 * @return hash code of this object.
 */
public int hashCode() {
  // Following two dates compare to EQUALS since in different timezones.
  // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00
  //
  // Must ensure both instances generate same hashcode by normalizing
  // this to UTC timezone.
  int timezone = getTimezone();
  if (timezone == DatatypeConstants.FIELD_UNDEFINED) {
    timezone = 0;
  }
  XMLGregorianCalendar gc = this;
  if (timezone != 0) {
    gc = this.normalizeToTimezone(getTimezone());
  }
  return gc.getYear() + gc.getMonth() + gc.getDay() +
      gc.getHour() + gc.getMinute() + gc.getSecond();
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 * <p>Returns a hash code consistent with the definition of the equals method.</p>
 *
 * @return hash code of this object.
 */
public int hashCode() {
  // Following two dates compare to EQUALS since in different timezones.
  // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00
  //
  // Must ensure both instances generate same hashcode by normalizing
  // this to UTC timezone.
  int timezone = getTimezone();
  if (timezone == DatatypeConstants.FIELD_UNDEFINED) {
    timezone = 0;
  }
  XMLGregorianCalendar gc = this;
  if (timezone != 0) {
    gc = this.normalizeToTimezone(getTimezone());
  }
  return gc.getYear() + gc.getMonth() + gc.getDay() +
      gc.getHour() + gc.getMinute() + gc.getSecond();
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com