net.time4j.tz.ZonalTransition.isOverlap()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(103)

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

ZonalTransition.isOverlap介绍

[英]Queries if this transition represents an overlap on the local timeline where local timestamps are ambivalent.
[中]询问此转换是否表示本地时间戳矛盾的本地时间轴上的重叠。

代码示例

代码示例来源:origin: net.time4j/time4j-core

throw new UnsupportedOperationException(msg);
} else if (conflict.isOverlap()) {
  long localSeconds = toLocalSeconds(y, m, d, h, min, s);
  int offset = conflict.getTotalOffset();

代码示例来源:origin: net.time4j/time4j-olson

ZonalTransition getConflictTransition(
  GregorianDate localDate,
  long localSecs
) {
  long preModel = this.initial.getPosixTime();
  int max =
    Math.max(
      this.initial.getPreviousOffset(),
      this.initial.getTotalOffset());
  if (localSecs <= preModel + max) {
    return null;
  }
  for (ZonalTransition t : this.getTransitions(localDate)) {
    long tt = t.getPosixTime();
    if (t.isGap()) {
      if (localSecs < tt + t.getPreviousOffset()) {
        return null; // offset = t.getPreviousOffset()
      } else if (localSecs < tt + t.getTotalOffset()) {
        return t;
      }
    } else if (t.isOverlap()) {
      if (localSecs < tt + t.getTotalOffset()) {
        return null; // offset = t.getPreviousOffset()
      } else if (localSecs < tt + t.getPreviousOffset()) {
        return t;
      }
    }
  }
  return null; // offset = lastTotalOffset
}

代码示例来源:origin: net.time4j/time4j-core

return ZonalOffset.ofTotalSeconds(offset);
} else if (conflict.isOverlap()) {
  if (this.overlapResolver == OverlapResolver.EARLIER_OFFSET) {
    offset = conflict.getPreviousOffset();

代码示例来源:origin: net.time4j/time4j-olson

List<ZonalOffset> getValidOffsets(
  GregorianDate localDate,
  long localSecs
) {
  long preModel = this.initial.getPosixTime();
  int last = this.initial.getTotalOffset();
  int max = Math.max(this.initial.getPreviousOffset(), last);
  if (localSecs <= preModel + max) {
    return TransitionModel.toList(last);
  }
  for (ZonalTransition t : this.getTransitions(localDate)) {
    long tt = t.getPosixTime();
    last = t.getTotalOffset();
    if (t.isGap()) {
      if (localSecs < tt + t.getPreviousOffset()) {
        return TransitionModel.toList(t.getPreviousOffset());
      } else if (localSecs < tt + last) {
        return Collections.emptyList();
      }
    } else if (t.isOverlap()) {
      if (localSecs < tt + last) {
        return TransitionModel.toList(t.getPreviousOffset());
      } else if (localSecs < tt + t.getPreviousOffset()) {
        return TransitionModel.toList(last, t.getPreviousOffset());
      }
    }
  }
  return TransitionModel.toList(last);
}

代码示例来源:origin: net.time4j/time4j-olson

return test;
} else if (test.isOverlap()) {
  assert (test.getPosixTime() + test.getPreviousOffset() > localSecs);
  if (test.getPosixTime() + test.getTotalOffset() <= localSecs) {

代码示例来源:origin: net.time4j/time4j-olson

return Collections.emptyList();
} else if (test.isOverlap()) {
  assert (test.getPosixTime() + test.getPreviousOffset() > localSecs);
  if (test.getPosixTime() + test.getTotalOffset() <= localSecs) {

相关文章