tmf: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / location / TmfLongLocation.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 /**
18 * A concrete implementation of TmfLocation based on Long:s
19 *
20 * @author Francois Chouinard
21 */
22 public final class TmfLongLocation extends TmfLocation {
23
24 /**
25 * Constructor
26 *
27 * @param locationInfo
28 * The concrete location
29 */
30 public TmfLongLocation(long locationInfo) {
31 super(Long.valueOf(locationInfo));
32 }
33
34 /**
35 * The normal constructor
36 *
37 * @param locationInfo the concrete location
38 */
39 public TmfLongLocation(final Long locationInfo) {
40 super(locationInfo);
41 }
42
43 /**
44 * The copy constructor
45 *
46 * @param other the other location
47 */
48 public TmfLongLocation(final TmfLongLocation other) {
49 super(other.getLocationInfo());
50 }
51
52 /**
53 * Construct the location from the ByteBuffer.
54 *
55 * @param bufferIn
56 * the buffer to read from
57 */
58 public TmfLongLocation(ByteBuffer bufferIn) {
59 this(bufferIn.getLong());
60 }
61
62 @Override
63 public Long getLocationInfo() {
64 return (Long) super.getLocationInfo();
65 }
66
67 @Override
68 public void serialize(ByteBuffer bufferOut) {
69 bufferOut.putLong(getLocationInfo().longValue());
70 }
71
72 }
This page took 0.042112 seconds and 5 git commands to generate.