com.kolibrifx.plovercrest.server.TableReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plovercrest-server Show documentation
Show all versions of plovercrest-server Show documentation
Plovercrest server library.
The newest version!
/*
* Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
*/
package com.kolibrifx.plovercrest.server;
import com.kolibrifx.plovercrest.server.internal.engine.DeferredReader;
public class TableReader {
private final DeferredReader iterator;
TableReader(final DeferredReader deferredReader) {
this.iterator = deferredReader;
}
public T read(final ReadObserver observer) {
return iterator.read(observer);
}
public long seekTakePrevious(final long desiredTimestamp) {
return iterator.seekTakePrevious(desiredTimestamp);
}
public long seekTakeNext(final long desiredTimestamp) {
return iterator.seekTakeNext(desiredTimestamp);
}
public long getLastTimestamp() {
return iterator.getLastTimestamp();
}
public long getFirstTimestamp() {
return iterator.getFirstTimestamp();
}
public long getLastValidTimestamp() {
return iterator.getLastValidTimestamp();
}
/**
* Seek to the N-th entry. If the index is beyond the end of the table, the reader will be at
* the end of the table (beyond the last entry).
*/
public void seekToEntryIndex(final long entryIndex) {
iterator.seekToEntryIndex(entryIndex);
}
/**
* Returns the index of the next entry to be read. If the reader is at the end of the table,
* this is the same as {@link Table#getEntryCount()}.
*/
public long getEntryIndex() {
return iterator.getEntryIndex();
}
}