Commit | Line | Data |
---|---|---|
cb8c854e | 1 | /******************************************************************************* |
61759503 | 2 | * Copyright (c) 2012, 2013 Ericsson |
cb8c854e FC |
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 | ||
a3db8436 | 13 | package org.eclipse.linuxtools.tmf.core.trace.location; |
cb8c854e | 14 | |
032ecd45 MAL |
15 | import java.nio.ByteBuffer; |
16 | ||
3bd46eef | 17 | import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp; |
032ecd45 | 18 | import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp; |
cb8c854e FC |
19 | |
20 | /** | |
83f4e378 FC |
21 | * A concrete implementation of TmfLocation based on ITmfTimestamp:s |
22 | * | |
23 | * @author Francois Chouinard | |
a3db8436 | 24 | * @since 3.0 |
cb8c854e | 25 | */ |
d62bb185 | 26 | public final class TmfTimestampLocation extends TmfLocation { |
cb8c854e | 27 | |
1e1bef82 | 28 | /** |
83f4e378 FC |
29 | * The normal constructor |
30 | * | |
31 | * @param locationInfo the concrete location | |
1e1bef82 | 32 | */ |
83f4e378 FC |
33 | public TmfTimestampLocation(final ITmfTimestamp locationInfo) { |
34 | super(locationInfo); | |
cb8c854e FC |
35 | } |
36 | ||
1e1bef82 | 37 | /** |
83f4e378 FC |
38 | * The copy constructor |
39 | * | |
1e1bef82 FC |
40 | * @param other the other location |
41 | */ | |
83f4e378 | 42 | public TmfTimestampLocation(final TmfTimestampLocation other) { |
5976d44a | 43 | super(other.getLocationInfo()); |
cb8c854e FC |
44 | } |
45 | ||
032ecd45 MAL |
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 | ||
577ee847 FC |
58 | @Override |
59 | public ITmfTimestamp getLocationInfo() { | |
60 | return (ITmfTimestamp) super.getLocationInfo(); | |
61 | } | |
62 | ||
032ecd45 MAL |
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 | } | |
cb8c854e | 71 | } |