* <p>
* This class maps an event timestamp to a generic location.
*/
+@SuppressWarnings("rawtypes")
public class TmfCheckpoint implements Comparable<TmfCheckpoint>, Cloneable {
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
private TmfTimestamp fTimestamp;
- private ITmfLocation<?> fLocation;
+ private ITmfLocation<? extends Comparable> fLocation;
// ------------------------------------------------------------------------
// Constructors
* @param ts the checkpoint timestamp
* @param location the corresponding trace location
*/
- public TmfCheckpoint(TmfTimestamp ts, ITmfLocation<?> location) {
+ public TmfCheckpoint(TmfTimestamp ts, ITmfLocation<? extends Comparable> location) {
fTimestamp = ts;
fLocation = location;
}
// Comparable
// ------------------------------------------------------------------------
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public int compareTo(TmfCheckpoint other) {
+ if (fTimestamp == null || other.fTimestamp == null) {
+ return fLocation.getLocation().compareTo(other.fLocation.getLocation());
+ }
return fTimestamp.compareTo(other.fTimestamp, false);
}