com.google.android.exoplayer2.util.Util.compareLong()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(119)

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

Util.compareLong介绍

[英]Compares two long values and returns the same value as Long.compare(long, long).
[中]比较两个long值并返回与long相同的值。比较(长,长)。

代码示例

代码示例来源:origin: google/ExoPlayer

@Override
 public int compareTo(@NonNull PendingMessage other) {
  int res = Util.compareLong(this.when, other.when);
  if (res == 0 && this != other) {
   res = Util.compareLong(this.sequenceNumber, other.sequenceNumber);
  }
  return res;
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
 public int compareTo(@NonNull Segment other) {
  return Util.compareLong(startTimeUs, other.startTimeUs);
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
 public int compareTo(@NonNull PendingMessageInfo other) {
  if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
   // PendingMessageInfos with a resolved period position are always smaller.
   return resolvedPeriodUid != null ? -1 : 1;
  }
  if (resolvedPeriodUid == null) {
   // Don't sort message with unresolved positions.
   return 0;
  }
  // Sort resolved media times by period index and then by period position.
  int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  if (comparePeriodIndex != 0) {
   return comparePeriodIndex;
  }
  return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
 public int compareTo(@NonNull PendingMessage other) {
  int res = Util.compareLong(this.when, other.when);
  if (res == 0 && this != other) {
   res = Util.compareLong(this.sequenceNumber, other.sequenceNumber);
  }
  return res;
 }
}

相关文章