Add javadoc and comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / ctfadaptor / CtfLocation.java
1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors: Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.linuxtools.tmf.core.ctfadaptor;
12
13 import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
14 import org.eclipse.linuxtools.tmf.core.trace.ITmfLocation;
15
16 /**
17 * The ctflocation is the nugget of information that is unique to a location in a trace.
18 * it can be copied and used to restore a position in a given trace.
19 */
20 public class CtfLocation implements ITmfLocation<Long> {
21
22 public static final Long INVALID_LOCATION = -1L;
23
24 /**
25 * Constructor for CtfLocation.
26 * @param location Long
27 */
28 public CtfLocation(Long location) {
29 setLocation(location);
30 }
31
32 /**
33 * Constructor for CtfLocation.
34 * @param timestamp ITmfTimestamp
35 */
36 public CtfLocation(ITmfTimestamp timestamp) {
37 setLocation(timestamp.getValue());
38 }
39
40 private Long fTimestamp;
41
42 /**
43 * Method setLocation.
44 * @param location Long
45 */
46 public void setLocation(Long location) {
47 this.fTimestamp = location;
48 }
49
50 /**
51 * Method getLocation.
52 * @return Long
53 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfLocation#getLocation()
54 */
55 @Override
56 public Long getLocation() {
57 return this.fTimestamp;
58 }
59
60 /**
61 * Method clone.
62 * @return CtfLocation
63 * @see org.eclipse.linuxtools.tmf.core.trace.ITmfLocation#clone()
64 */
65 @Override
66 public CtfLocation clone() {
67 return new CtfLocation(getLocation());
68 }
69
70 }
This page took 0.033256 seconds and 6 git commands to generate.