Commit | Line | Data |
---|---|---|
cb8c854e | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2012, 2014 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 | ||
2bdf0193 | 13 | package org.eclipse.tracecompass.tmf.core.trace.location; |
cb8c854e | 14 | |
032ecd45 MAL |
15 | import java.nio.ByteBuffer; |
16 | ||
2bdf0193 AM |
17 | import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp; |
18 | import org.eclipse.tracecompass.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 | |
cb8c854e | 24 | */ |
d62bb185 | 25 | public final class TmfTimestampLocation extends TmfLocation { |
cb8c854e | 26 | |
1e1bef82 | 27 | /** |
83f4e378 FC |
28 | * The normal constructor |
29 | * | |
30 | * @param locationInfo the concrete location | |
1e1bef82 | 31 | */ |
83f4e378 FC |
32 | public TmfTimestampLocation(final ITmfTimestamp locationInfo) { |
33 | super(locationInfo); | |
cb8c854e FC |
34 | } |
35 | ||
1e1bef82 | 36 | /** |
83f4e378 FC |
37 | * The copy constructor |
38 | * | |
1e1bef82 FC |
39 | * @param other the other location |
40 | */ | |
83f4e378 | 41 | public TmfTimestampLocation(final TmfTimestampLocation other) { |
5976d44a | 42 | super(other.getLocationInfo()); |
cb8c854e FC |
43 | } |
44 | ||
032ecd45 MAL |
45 | /** |
46 | * Construct the location from the ByteBuffer. | |
47 | * | |
48 | * @param bufferIn | |
49 | * the buffer to read from | |
032ecd45 MAL |
50 | */ |
51 | public TmfTimestampLocation(ByteBuffer bufferIn) { | |
52 | super(new TmfTimestamp(bufferIn)); | |
53 | } | |
54 | ||
577ee847 FC |
55 | @Override |
56 | public ITmfTimestamp getLocationInfo() { | |
57 | return (ITmfTimestamp) super.getLocationInfo(); | |
58 | } | |
59 | ||
032ecd45 MAL |
60 | @Override |
61 | public void serialize(ByteBuffer bufferOut) { | |
62 | TmfTimestamp t = new TmfTimestamp(getLocationInfo()); | |
63 | t.serialize(bufferOut); | |
64 | } | |
cb8c854e | 65 | } |