org.joda.time.Instant.isEqual()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(104)

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

Instant.isEqual介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Checks if the provided range r is within the current range.
 * Note that equal ranges also returns true.
 *
 * @param r range
 * @return true if range r is contained in r
 */
public boolean contains(Range r) {
 if ((this.beginTime().getJodaTimeInstant().isBefore(r.beginTime().getJodaTimeInstant())
         || this.beginTime().getJodaTimeInstant().isEqual(r.beginTime().getJodaTimeInstant()))
     && (this.endTime().getJodaTimeInstant().isAfter(r.endTime().getJodaTimeInstant())
         || this.endTime().getJodaTimeInstant().isEqual(r.endTime().getJodaTimeInstant()))) {
  return true;
 }
 return false;
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@Override
public boolean equals(Object o) {
 return (o instanceof IntervalWindow)
   && ((IntervalWindow) o).end.isEqual(end)
   && ((IntervalWindow) o).start.isEqual(start);
}

代码示例来源:origin: dataArtisans/flink-dataflow

private void setCurrentInputWatermarkAfterRecovery(Instant watermark) {
  if (!currentInputWatermark.isEqual(BoundedWindow.TIMESTAMP_MIN_VALUE)) {
    throw new RuntimeException("Explicitly setting the input watermark is only allowed on " +
        "initialization after recovery from a node failure. Apparently this is not " +
        "the case here as the watermark is already set.");
  }
  this.currentInputWatermark = watermark;
}

代码示例来源:origin: dataArtisans/flink-dataflow

private void setCurrentOutputWatermarkAfterRecovery(Instant watermark) {
  if (!currentOutputWatermark.isEqual(BoundedWindow.TIMESTAMP_MIN_VALUE)) {
    throw new RuntimeException("Explicitly setting the output watermark is only allowed on " +
      "initialization after recovery from a node failure. Apparently this is not " +
      "the case here as the watermark is already set.");
  }
  this.currentOutputWatermark = watermark;
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@Override
public int compareTo(IntervalWindow o) {
 if (start.isEqual(o.start)) {
  return end.compareTo(o.end);
 }
 return start.compareTo(o.start);
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@Override
public boolean equals(Object o) {
 if (o instanceof TimestampedValueInSingleWindow) {
  TimestampedValueInSingleWindow<?> that = (TimestampedValueInSingleWindow<?>) o;
  // Compare timestamps first as they are most likely to differ.
  // Also compare timestamps according to millis-since-epoch because otherwise expensive
  // comparisons are made on their Chronology objects.
  return this.getTimestamp().isEqual(that.getTimestamp())
    && Objects.equals(that.getValue(), this.getValue())
    && Objects.equals(that.getPane(), this.getPane())
    && Objects.equals(that.window, this.window);
 } else {
  return super.equals(o);
 }
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@Override
public boolean equals(Object other) {
 if (!(other instanceof WindowedValue)) {
  return false;
 } else {
  WindowedValue<?> that = (WindowedValue<?>) other;
  // Compare timestamps first as they are most likely to differ.
  // Also compare timestamps according to millis-since-epoch because otherwise expensive
  // comparisons are made on their Chronology objects.
  return this.getTimestamp().isEqual(that.getTimestamp())
    && Objects.equals(this.getValue(), that.getValue())
    && Objects.equals(this.getWindows(), that.getWindows())
    && Objects.equals(this.getPane(), that.getPane());
 }
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@Override
public boolean equals(Object o) {
 if (o instanceof TimestampedValueInGlobalWindow) {
  TimestampedValueInGlobalWindow<?> that = (TimestampedValueInGlobalWindow<?>) o;
  // Compare timestamps first as they are most likely to differ.
  // Also compare timestamps according to millis-since-epoch because otherwise expensive
  // comparisons are made on their Chronology objects.
  return this.getTimestamp().isEqual(that.getTimestamp())
    && Objects.equals(that.getPane(), this.getPane())
    && Objects.equals(that.getValue(), this.getValue());
 } else {
  return super.equals(o);
 }
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-core

@Override
public boolean equals(Object o) {
 if (o instanceof TimestampedValueInMultipleWindows) {
  TimestampedValueInMultipleWindows<?> that = (TimestampedValueInMultipleWindows<?>) o;
  // Compare timestamps first as they are most likely to differ.
  // Also compare timestamps according to millis-since-epoch because otherwise expensive
  // comparisons are made on their Chronology objects.
  if (this.getTimestamp().isEqual(that.getTimestamp())
    && Objects.equals(that.getValue(), this.getValue())
    && Objects.equals(that.getPane(), this.getPane())) {
   ensureWindowsAreASet();
   that.ensureWindowsAreASet();
   return that.windows.equals(this.windows);
  } else {
   return false;
  }
 } else {
  return super.equals(o);
 }
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

/**
 * Checks if the provided range r is within the current range.
 * Note that equal ranges also returns true.
 *
 * @param r range
 * @return true if range r is contained in r
 */
public boolean contains(Range r) {
 if ((this.beginTime().getJodaTimeInstant().isBefore(r.beginTime().getJodaTimeInstant())
         || this.beginTime().getJodaTimeInstant().isEqual(r.beginTime().getJodaTimeInstant()))
     && (this.endTime().getJodaTimeInstant().isAfter(r.endTime().getJodaTimeInstant())
         || this.endTime().getJodaTimeInstant().isEqual(r.endTime().getJodaTimeInstant()))) {
  return true;
 }
 return false;
}

代码示例来源:origin: timolson/cointrader

if (childOrder != null && childOrder.getExpiration() != null && !childOrder.getExpiration().isEqual(order.getExpiration()))
  throw new Error("Child order expirations must match parent order expirations");
boolean fullyExpired = true;

代码示例来源:origin: org.apache.beam/beam-runners-core-java

newHold.isEqual(
  LateDataUtils.garbageCollectionTime(directContext.window(), windowingStrategy)),
"new hold %s should be at garbage collection for window %s plus %s",
newHold.isEqual(directContext.window().maxTimestamp()),
"new hold %s should be at end of window %s",
newHold,

相关文章