1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.core
.trace
.location
;
15 import java
.nio
.ByteBuffer
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.ITmfTimestamp
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimestamp
;
21 * A concrete implementation of TmfLocation based on ITmfTimestamp:s
23 * @author Francois Chouinard
25 public final class TmfTimestampLocation
extends TmfLocation
{
28 * The normal constructor
30 * @param locationInfo the concrete location
32 public TmfTimestampLocation(final ITmfTimestamp locationInfo
) {
37 * The copy constructor
39 * @param other the other location
41 public TmfTimestampLocation(final TmfTimestampLocation other
) {
42 super(other
.getLocationInfo());
46 * Construct the location from the ByteBuffer.
49 * the buffer to read from
51 public TmfTimestampLocation(ByteBuffer bufferIn
) {
52 super(new TmfTimestamp(bufferIn
));
56 public ITmfTimestamp
getLocationInfo() {
57 return (ITmfTimestamp
) super.getLocationInfo();
61 public void serialize(ByteBuffer bufferOut
) {
62 TmfTimestamp t
= new TmfTimestamp(getLocationInfo());
63 t
.serialize(bufferOut
);