* @version 1.0
* @author Matthew Khouzam
*/
-public class CtfLocation implements ITmfLocation<CtfLocationData>, Cloneable {
+public final class CtfLocation implements ITmfLocation {
- private CtfLocationData fLocation;
+ private final CtfLocationData fLocation;
/**
* An invalid location
* @param timestamp
* The timestamp of this location
*/
- public CtfLocation(ITmfTimestamp timestamp) {
- setLocation(new CtfLocationData(timestamp.getValue(), 0));
+ public CtfLocation(final ITmfTimestamp timestamp) {
+ this(timestamp.getValue(), 0);
}
/**
* The index of this location for this timestamp
* @since 2.0
*/
- public CtfLocation(ITmfTimestamp timestamp, long index) {
- setLocation(new CtfLocationData(timestamp.getValue(), index));
+ public CtfLocation(final ITmfTimestamp timestamp, long index) {
+ this(timestamp.getValue(), index);
}
/**
- * Copy constructor
+ * Change this location's timestamp and index values.
*
- * @param location
- * Other location to copy
+ * @param timestampValue
+ * The new timestamp
+ * @param index
+ * The new index
* @since 2.0
*/
- public CtfLocation(CtfLocationData location) {
- setLocation(location);
+ public CtfLocation(final long timestampValue, final long index) {
+ this(new CtfLocationData(timestampValue, index));
}
/**
- * Move this location to another location's position.
+ * Copy constructor
*
* @param location
- * The location to seek to
- * @since 2.0
- */
- public void setLocation(CtfLocationData location) {
- this.fLocation = location;
- }
-
- /**
- * Change this location's timestamp and index values.
- *
- * @param timestampValue
- * The new timestamp
- * @param index
- * The new index
+ * Other location to copy
* @since 2.0
*/
- public void setLocation(long timestampValue, long index) {
- this.fLocation = new CtfLocationData(timestampValue, index);
+ public CtfLocation(final CtfLocationData location) {
+ fLocation = location;
}
-
/**
* Get the Location Data of this location
*
* @return The CtfLocationData
- * @see org.eclipse.linuxtools.tmf.core.trace.ITmfLocation#getLocationData()
+ * @see org.eclipse.linuxtools.tmf.core.trace.ITmfLocation#getLocationInfo()
* @since 2.0
*/
@Override
- public CtfLocationData getLocationData() {
+ public CtfLocationData getLocationInfo() {
return fLocation;
}
*/
@Override
public String toString() {
- if( this.getLocationData().equals(CtfLocation.INVALID_LOCATION )) {
+ if( this.getLocationInfo().equals(CtfLocation.INVALID_LOCATION )) {
return "CtfLocation: INVALID"; //$NON-NLS-1$
}
- return "CtfLocation: " + getLocationData().toString(); //$NON-NLS-1$
+ return "CtfLocation: " + getLocationInfo().toString(); //$NON-NLS-1$
}
-
}