X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=org.eclipse.linuxtools.tmf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Ftmf%2Fcore%2Ftrace%2Flocation%2FTmfLongLocation.java;h=fdb249f10a8be51a4a17d91bf806729f8cc225aa;hb=60ae41e177bc783d3a400742bb4728b94dcf5c97;hp=38877ca7ea1e1493425b26d5ad19e635127cf4e0;hpb=22af2cac7c00f55e3669c95392d824a9bf76a1fc;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java index 38877ca7ea..fdb249f10a 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/location/TmfLongLocation.java @@ -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()); + } + }