* it does not have a file handle, so many iterators can be used without worries
* of io errors.
*/
-public class CtfIterator extends CTFTraceReader implements ITmfContext,
- Comparable<CtfIterator> {
+public class CtfIterator extends CTFTraceReader implements ITmfContext, Comparable<CtfIterator>, Cloneable {
private final CtfTmfTrace ctfTmfTrace;
public boolean seek(final long timestamp) {
boolean ret = false;
final long offsetTimestamp = timestamp
- - this.getCtfTmfTrace().getCTFTrace().getOffset();
+ - this.getTrace().getOffset();
if (offsetTimestamp < 0) {
ret = super.seek(timestamp);
} else {
return ret;
}
- /**
- * Method seekRank. seeks to a given rank
- * @param rank long the rank to seek to
- * @return boolean
- */
- public boolean seekRank(final long rank) {
- boolean ret = false;
- ret = super.seekIndex(rank);
-
- if (ret) {
- curLocation.setLocation(getCurrentEvent().getTimestampValue());
- } else {
- curLocation = NULL_LOCATION;
- }
- return ret;
- }
-
/**
* Method getRank.
* @return long
*/
@Override
public void increaseRank() {
- curRank++;
+ /* Only increase the rank if it's valid */
+ if(hasValidRank()) {
+ curRank++;
+ }
}
/**