当前位置: 首页>>代码示例>>Java>>正文


Java Timestamped.getTimestampMillis方法代码示例

本文整理汇总了Java中rx.schedulers.Timestamped.getTimestampMillis方法的典型用法代码示例。如果您正苦于以下问题:Java Timestamped.getTimestampMillis方法的具体用法?Java Timestamped.getTimestampMillis怎么用?Java Timestamped.getTimestampMillis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rx.schedulers.Timestamped的用法示例。


在下文中一共展示了Timestamped.getTimestampMillis方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRecentPhotosFilter

import rx.schedulers.Timestamped; //导入方法依赖的package包/类
private Func1<Timestamped<RecentPhotosResponse>, Boolean> getRecentPhotosFilter(final ITimestampedView timestampedView) {
    return new Func1<Timestamped<RecentPhotosResponse>, Boolean>() {
        @Override
        public Boolean call(Timestamped<RecentPhotosResponse> recentPhotosResponseTimestamped) {

            StringBuilder logMessage = new StringBuilder("getMergedPhotos().filter() - Filtering results");
            if (recentPhotosResponseTimestamped == null) {
                logMessage.append(", recentPhotosResponseTimestamped is null");
            } else {
                logMessage.append(", timestamps=").append(recentPhotosResponseTimestamped.getTimestampMillis()).append(">").append(timestampedView.getViewDataTimestampMillis()).append("?");
            }
            logMessage.append(", thread=").append(Thread.currentThread().getName());
            Log.d(CLASSNAME, logMessage.toString());

            // filter it
            // if result is null - ignore it
            // if timestamp of new arrived (emission) data is less than timestamp of already displayed data — ignore it.
            return recentPhotosResponseTimestamped != null
                    && recentPhotosResponseTimestamped.getValue() != null
                    && recentPhotosResponseTimestamped.getValue().photos != null
                    && recentPhotosResponseTimestamped.getTimestampMillis() > timestampedView.getViewDataTimestampMillis();
        }
    };
}
 
开发者ID:murki,项目名称:chaining-rxjava,代码行数:25,代码来源:FlickrDomainService.java

示例2: truncate

import rx.schedulers.Timestamped; //导入方法依赖的package包/类
@Override
void truncate() {
  long timeLimit = scheduler.now() - maxAgeInMillis;

  Node prev = get();
  Node next = prev.get();

  int e = 0;
  for (;;) {
    if (next != null) {
      if (size > limit) {
        e++;
        size--;
        prev = next;
        next = next.get();
      } else {
        Timestamped<?> v = (Timestamped<?>)next.value;
        if (v.getTimestampMillis() <= timeLimit) {
          e++;
          size--;
          prev = next;
          next = next.get();
        } else {
          break;
        }
      }
    } else {
      break;
    }
  }
  if (e != 0) {
    setFirst(prev);
  }
}
 
开发者ID:vinli,项目名称:android-bt,代码行数:35,代码来源:OperatorReplayFix.java

示例3: truncateFinal

import rx.schedulers.Timestamped; //导入方法依赖的package包/类
@Override
void truncateFinal() {
  long timeLimit = scheduler.now() - maxAgeInMillis;

  Node prev = get();
  Node next = prev.get();

  int e = 0;
  for (;;) {
    if (next != null && size > 1) {
      Timestamped<?> v = (Timestamped<?>)next.value;
      if (v.getTimestampMillis() <= timeLimit) {
        e++;
        size--;
        prev = next;
        next = next.get();
      } else {
        break;
      }
    } else {
      break;
    }
  }
  if (e != 0) {
    setFirst(prev);
  }
}
 
开发者ID:vinli,项目名称:android-bt,代码行数:28,代码来源:OperatorReplayFix.java

示例4: call

import rx.schedulers.Timestamped; //导入方法依赖的package包/类
@Override public Boolean call(Timestamped<T> tTimestamped) {
  return scheduler.now() - tTimestamped.getTimestampMillis() < expiryMs;
}
 
开发者ID:hannesstruss,项目名称:RxCache,代码行数:4,代码来源:RxCache.java

示例5: test

import rx.schedulers.Timestamped; //导入方法依赖的package包/类
@Override
public boolean test(Object value, long now) {
    Timestamped<?> ts = (Timestamped<?>)value;
    return ts.getTimestampMillis() <= now - maxAgeMillis;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:6,代码来源:ReplaySubject.java


注:本文中的rx.schedulers.Timestamped.getTimestampMillis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。