From 1f017344ad579b039581967110328350ebc58a94 Mon Sep 17 00:00:00 2001 From: Oscar Vega-Gisbert Date: Tue, 20 May 2014 21:12:39 +0000 Subject: [PATCH] Java-oshmem: replace Addr.offset/duplicate by slice This commit was SVN r31843. --- oshmem/shmem/java/java/Addr.java | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/oshmem/shmem/java/java/Addr.java b/oshmem/shmem/java/java/Addr.java index 2feceb173d..1d8c80601b 100644 --- a/oshmem/shmem/java/java/Addr.java +++ b/oshmem/shmem/java/java/Addr.java @@ -1,7 +1,6 @@ package shmem; import java.nio.*; -import static shmem.ShMem.slice; /** * Symmetric data object. @@ -66,36 +65,25 @@ private native ByteBuffer realloc(long addr, int size); /** * Creates a new object that shares this object's content. - *

Offsets will be the same at the beginning, but they will be independents. - * @return The new object. + * @param offset Offset of the new data object. + * @return New data object. */ -public Addr duplicate() +public Addr slice(int offset) { Addr addr = new Addr(); addr.handle = handle; addr.offset = offset; - addr.buffer = buffer.duplicate(); + addr.buffer = buffer; return addr; } -/** - * Sets the current offset of the data object. - * @param offset Offset of the data object. - * @return This data object. - */ -public Addr offset(int offset) -{ - this.offset = offset; - return this; -} - /** * Gets a view of this object as a byte buffer. * @return Byte buffer. */ public ByteBuffer asByteBuffer() { - return slice(buffer, offset); + return ShMem.slice(buffer, offset); } /**