*/
public class CtfLocationInfo implements Comparable<CtfLocationInfo> {
- private final long timestamp;
- private final long index;
+ private final long fTimestamp;
+ private final long fIndex;
/**
* @param ts
* timestamp, which one is it.)
*/
public CtfLocationInfo(long ts, long index) {
- this.timestamp = ts;
- this.index = index;
+ fTimestamp = ts;
+ fIndex = index;
}
/**
* @since 3.0
*/
public CtfLocationInfo(ByteBuffer bufferIn) {
- timestamp = bufferIn.getLong();
- index = bufferIn.getLong();
+ fTimestamp = bufferIn.getLong();
+ fIndex = bufferIn.getLong();
}
/**
* @return The timestamp
*/
public long getTimestamp() {
- return timestamp;
+ return fTimestamp;
}
/**
* @return The index of the element
*/
public long getIndex() {
- return index;
+ return fIndex;
}
// ------------------------------------------------------------------------
public int hashCode() {
final int prime = 31;
int result = 1;
- result = (prime * result) + (int) (index ^ (index >>> 32));
- result = (prime * result) + (int) (timestamp ^ (timestamp >>> 32));
+ result = (prime * result) + (int) (fIndex ^ (fIndex >>> 32));
+ result = (prime * result) + (int) (fTimestamp ^ (fTimestamp >>> 32));
return result;
}
return false;
}
CtfLocationInfo other = (CtfLocationInfo) obj;
- if (index != other.index) {
+ if (fIndex != other.fIndex) {
return false;
}
- if (timestamp != other.timestamp) {
+ if (fTimestamp != other.fTimestamp) {
return false;
}
return true;
@Override
public String toString() {
- return "Element [" + timestamp + '/' + index + ']'; //$NON-NLS-1$
+ return "Element [" + fTimestamp + '/' + fIndex + ']'; //$NON-NLS-1$
}
// ------------------------------------------------------------------------
@Override
public int compareTo(CtfLocationInfo other) {
- if (this.timestamp > other.getTimestamp()) {
+ if (fTimestamp > other.getTimestamp()) {
return 1;
}
- if (this.timestamp < other.getTimestamp()) {
+ if (fTimestamp < other.getTimestamp()) {
return -1;
}
- if (this.index > other.getIndex()) {
+ if (fIndex > other.getIndex()) {
return 1;
}
- if (this.index < other.getIndex()) {
+ if (fIndex < other.getIndex()) {
return -1;
}
return 0;
* @since 3.0
*/
public void serialize(ByteBuffer bufferOut) {
- bufferOut.putLong(timestamp);
- bufferOut.putLong(index);
+ bufferOut.putLong(fTimestamp);
+ bufferOut.putLong(fIndex);
}
}