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

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

本文整理了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

  1. @Override
  2. public int compareTo(@NonNull PendingMessage other) {
  3. int res = Util.compareLong(this.when, other.when);
  4. if (res == 0 && this != other) {
  5. res = Util.compareLong(this.sequenceNumber, other.sequenceNumber);
  6. }
  7. return res;
  8. }
  9. }

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

  1. @Override
  2. public int compareTo(@NonNull Segment other) {
  3. return Util.compareLong(startTimeUs, other.startTimeUs);
  4. }
  5. }

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

  1. @Override
  2. public int compareTo(@NonNull PendingMessageInfo other) {
  3. if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
  4. // PendingMessageInfos with a resolved period position are always smaller.
  5. return resolvedPeriodUid != null ? -1 : 1;
  6. }
  7. if (resolvedPeriodUid == null) {
  8. // Don't sort message with unresolved positions.
  9. return 0;
  10. }
  11. // Sort resolved media times by period index and then by period position.
  12. int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  13. if (comparePeriodIndex != 0) {
  14. return comparePeriodIndex;
  15. }
  16. return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
  17. }
  18. }

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

  1. @Override
  2. public int compareTo(@NonNull PendingMessage other) {
  3. int res = Util.compareLong(this.when, other.when);
  4. if (res == 0 && this != other) {
  5. res = Util.compareLong(this.sequenceNumber, other.sequenceNumber);
  6. }
  7. return res;
  8. }
  9. }

相关文章