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
26 public final class TmfTimestampLocation
extends TmfLocation
{
29 * The normal constructor
31 * @param locationInfo the concrete location
33 public TmfTimestampLocation(final ITmfTimestamp locationInfo
) {
38 * The copy constructor
40 * @param other the other location
42 public TmfTimestampLocation(final TmfTimestampLocation other
) {
43 super(other
.getLocationInfo());
47 * Construct the location from the ByteBuffer.
50 * the buffer to read from
54 public TmfTimestampLocation(ByteBuffer bufferIn
) {
55 super(new TmfTimestamp(bufferIn
));
59 public ITmfTimestamp
getLocationInfo() {
60 return (ITmfTimestamp
) super.getLocationInfo();
67 public void serialize(ByteBuffer bufferOut
) {
68 TmfTimestamp t
= new TmfTimestamp(getLocationInfo());
69 t
.serialize(bufferOut
);