diff options
author | Sven Gothel <[email protected]> | 2011-02-10 01:35:58 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-10 01:35:58 +0100 |
commit | 29eb568b642faac9475665d000a865fe684d42a4 (patch) | |
tree | 48d0fee6df82ce4f8fe35c3466cb3ed8690251dc /src/java/com/jogamp/common/nio/AbstractLongBuffer.java | |
parent | cbb0bc1ef3d8c0464618c9f773cd1b4725059971 (diff) | |
parent | e581ea0e1f65101a7d4baf99d18fa43e1aa20b01 (diff) |
Merge branch 'master' of github.com:mbien/gluegen
Diffstat (limited to 'src/java/com/jogamp/common/nio/AbstractLongBuffer.java')
-rw-r--r-- | src/java/com/jogamp/common/nio/AbstractLongBuffer.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/java/com/jogamp/common/nio/AbstractLongBuffer.java b/src/java/com/jogamp/common/nio/AbstractLongBuffer.java index c1ff409..c097e2e 100644 --- a/src/java/com/jogamp/common/nio/AbstractLongBuffer.java +++ b/src/java/com/jogamp/common/nio/AbstractLongBuffer.java @@ -33,8 +33,6 @@ package com.jogamp.common.nio; import com.jogamp.common.os.*; import java.nio.ByteBuffer; -import java.nio.Buffer; -import java.util.HashMap; /** * Hardware independent container for native pointer arrays. @@ -45,12 +43,10 @@ import java.util.HashMap; * @author Michael Bien * @author Sven Gothel */ -public abstract class AbstractLongBuffer extends AbstractBuffer { +public abstract class AbstractLongBuffer<B extends AbstractLongBuffer> extends AbstractBuffer<B> { protected long[] backup; - protected HashMap/*<aptr, buffer>*/ dataMap = new HashMap(); - static { NativeLibrary.ensureNativeLibLoaded(); } @@ -67,6 +63,7 @@ public abstract class AbstractLongBuffer extends AbstractBuffer { } } + @Override public final boolean hasArray() { return true; } @@ -104,13 +101,13 @@ public abstract class AbstractLongBuffer extends AbstractBuffer { } /** Absolute put method. Put the pointer value at the given index */ - public abstract AbstractLongBuffer put(int index, long value); + public abstract B put(int index, long value); /** Relative put method. Put the pointer value at the current position and increment the position by one. */ - public final AbstractLongBuffer put(long value) { + public final B put(long value) { put(position, value); position++; - return this; + return (B) this; } /** @@ -133,13 +130,13 @@ public abstract class AbstractLongBuffer extends AbstractBuffer { /** * Relative bulk get method. Copy the source values <code> src[position .. capacity] [</code> * to this buffer and increment the position by <code>capacity-position</code>. */ - public AbstractLongBuffer put(AbstractLongBuffer src) { + public B put(B src) { if (remaining() < src.remaining()) { throw new IndexOutOfBoundsException(); } while (src.hasRemaining()) { put(src.get()); } - return this; + return (B) this; } } |