Copyright header update, 2015 edition
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / location / TmfTimestampLocation.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made 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:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.tmf.core.trace.location;
14
15 import java.nio.ByteBuffer;
16
17 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
18 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
19
20 /**
21 * A concrete implementation of TmfLocation based on ITmfTimestamp:s
22 *
23 * @author Francois Chouinard
24 * @since 3.0
25 */
26 public final class TmfTimestampLocation extends TmfLocation {
27
28 /**
29 * The normal constructor
30 *
31 * @param locationInfo the concrete location
32 */
33 public TmfTimestampLocation(final ITmfTimestamp locationInfo) {
34 super(locationInfo);
35 }
36
37 /**
38 * The copy constructor
39 *
40 * @param other the other location
41 */
42 public TmfTimestampLocation(final TmfTimestampLocation other) {
43 super(other.getLocationInfo());
44 }
45
46 /**
47 * Construct the location from the ByteBuffer.
48 *
49 * @param bufferIn
50 * the buffer to read from
51 *
52 * @since 3.0
53 */
54 public TmfTimestampLocation(ByteBuffer bufferIn) {
55 super(new TmfTimestamp(bufferIn));
56 }
57
58 @Override
59 public ITmfTimestamp getLocationInfo() {
60 return (ITmfTimestamp) super.getLocationInfo();
61 }
62
63 /**
64 * @since 3.0
65 */
66 @Override
67 public void serialize(ByteBuffer bufferOut) {
68 TmfTimestamp t = new TmfTimestamp(getLocationInfo());
69 t.serialize(bufferOut);
70 }
71 }
This page took 0.0400509999999999 seconds and 6 git commands to generate.