tmf/lttng: Update 2014 copyrights
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / location / TmfLongLocation.java
index 38877ca7ea1e1493425b26d5ad19e635127cf4e0..fdb249f10a8be51a4a17d91bf806729f8cc225aa 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -12,6 +12,7 @@
 
 package org.eclipse.linuxtools.tmf.core.trace.location;
 
+import java.nio.ByteBuffer;
 
 /**
  * A concrete implementation of TmfLocation based on Long:s
@@ -21,6 +22,16 @@ package org.eclipse.linuxtools.tmf.core.trace.location;
  */
 public final class TmfLongLocation extends TmfLocation {
 
+    /**
+     * Constructor
+     *
+     * @param locationInfo
+     *            The concrete location
+     */
+    public TmfLongLocation(long locationInfo) {
+        super(Long.valueOf(locationInfo));
+    }
+
     /**
      * The normal constructor
      *
@@ -39,9 +50,29 @@ public final class TmfLongLocation extends TmfLocation {
         super(other.getLocationInfo());
     }
 
+    /**
+     * Construct the location from the ByteBuffer.
+     *
+     * @param bufferIn
+     *            the buffer to read from
+     *
+     * @since 3.0
+     */
+    public TmfLongLocation(ByteBuffer bufferIn) {
+        this(bufferIn.getLong());
+    }
+
     @Override
     public Long getLocationInfo() {
         return (Long) super.getLocationInfo();
     }
 
+    /**
+     * @since 3.0
+     */
+    @Override
+    public void serialize(ByteBuffer bufferOut) {
+        bufferOut.putLong(getLocationInfo().longValue());
+    }
+
 }
This page took 0.027597 seconds and 5 git commands to generate.