本文整理汇总了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();
}
};
}
示例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);
}
}
示例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);
}
}
示例4: call
import rx.schedulers.Timestamped; //导入方法依赖的package包/类
@Override public Boolean call(Timestamped<T> tTimestamped) {
return scheduler.now() - tTimestamped.getTimestampMillis() < expiryMs;
}
示例5: test
import rx.schedulers.Timestamped; //导入方法依赖的package包/类
@Override
public boolean test(Object value, long now) {
Timestamped<?> ts = (Timestamped<?>)value;
return ts.getTimestampMillis() <= now - maxAgeMillis;
}