X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.tmf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Ftmf%2Fcore%2Fctfadaptor%2FCtfLocation.java;h=01da9726134c640bf15dfae5bbb3a166a187e9ba;hb=d62bb1853c3388385d5ce10b0302b3dde139c3ab;hp=d55aafaa6273506074eaa6352f1986eb315590fa;hpb=6bab45115d11024d702e1d83c41aaaa3d9bebafa;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfLocation.java index d55aafaa62..01da972613 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfLocation.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfLocation.java @@ -21,9 +21,9 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation; * @version 1.0 * @author Matthew Khouzam */ -public class CtfLocation implements ITmfLocation, Cloneable { +public final class CtfLocation implements ITmfLocation { - private CtfLocationData fLocation; + private final CtfLocationData fLocation; /** * An invalid location @@ -36,8 +36,8 @@ public class CtfLocation implements ITmfLocation, Cloneable { * @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); } /** @@ -49,55 +49,43 @@ public class CtfLocation implements ITmfLocation, Cloneable { * 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; } @@ -149,11 +137,10 @@ public class CtfLocation implements ITmfLocation, Cloneable { */ @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$ } - }