From c0da2641298d4ccc6fd491b0ed0a5117292d1c20 Mon Sep 17 00:00:00 2001 From: Michael Koch <konqueror@gmx.de> Date: Tue, 11 Feb 2003 06:51:34 +0000 Subject: 2003-02-11 Michael Koch <konqueror@gmx.de> * java/nio/DoubleBuffer.java (DoubleBuffer): Implements Comparable. (endian): Removed. (array_offset): New member variable. (DoubleBuffer): New constuctor. (get): May not be final. (put): May not be final. (arrayOffset): Implemented. (order): Made abstract. (order): Removed. (as*Buffer): Removed. (get*): Removed. (put*): Removed. * java/nio/FloatBuffer.java (FloatBuffer): Implements Comparable. (endian): Removed. (array_offset): New member variable. (FloatBuffer): New constuctor. (get): May not be final. (put): May not be final. (arrayOffset): Implemented. (order): Made abstract. (order): Removed. (as*Buffer): Removed. (get*): Removed. (put*): Removed. * java/nio/IntBuffer.java (IntBuffer): Implements Comparable. (endian): Removed. (array_offset): New member variable. (IntBuffer): New constuctor. (get): May not be final. (put): May not be final. (arrayOffset): Implemented. (order): Made abstract. (order): Removed. (as*Buffer): Removed. (get*): Removed. (put*): Removed. * java/nio/LongBuffer.java (LongBuffer): Implements Comparable. (endian): Removed. (array_offset): New member variable. (LongBuffer): New constuctor. (get): May not be final. (put): May not be final. (arrayOffset): Implemented. (order): Made abstract. (order): Removed. (as*Buffer): Removed. (get*): Removed. (put*): Removed. * java/nio/ShortBuffer.java (ShortBuffer): Implements Comparable. (endian): Removed. (array_offset): New member variable. (ShortBuffer): New constuctor. (get): May not be final. (put): May not be final. (arrayOffset): Implemented. (order): Made abstract. (order): Removed. (as*Buffer): Removed. (get*): Removed. (put*): Removed. From-SVN: r62684 --- libjava/java/nio/ShortBuffer.java | 62 +++++++++------------------------------ 1 file changed, 14 insertions(+), 48 deletions(-) (limited to 'libjava/java/nio/ShortBuffer.java') diff --git a/libjava/java/nio/ShortBuffer.java b/libjava/java/nio/ShortBuffer.java index 5301366..08c05c4 100644 --- a/libjava/java/nio/ShortBuffer.java +++ b/libjava/java/nio/ShortBuffer.java @@ -39,10 +39,10 @@ package java.nio; import gnu.java.nio.ShortBufferImpl; -public abstract class ShortBuffer extends Buffer +public abstract class ShortBuffer extends Buffer implements Comparable { - private ByteOrder endian = ByteOrder.BIG_ENDIAN; protected short [] backing_buffer; + protected int array_offset; public static ShortBuffer allocateDirect(int capacity) { @@ -77,7 +77,13 @@ public abstract class ShortBuffer extends Buffer return wrap(array, 0, array.length); } - final public ShortBuffer get(short[] dst, int offset, int length) + ShortBuffer (int capacity, int limit, int position, int mark) + { + super (capacity, limit, position, mark); + array_offset = 0; + } + + public ShortBuffer get (short[] dst, int offset, int length) { for (int i = offset; i < offset + length; i++) { @@ -87,12 +93,12 @@ public abstract class ShortBuffer extends Buffer return this; } - final public ShortBuffer get(short[] dst) + public ShortBuffer get (short[] dst) { return get(dst, 0, dst.length); } - final public ShortBuffer put(ShortBuffer src) + public ShortBuffer put (ShortBuffer src) { while (src.hasRemaining()) put(src.get()); @@ -100,7 +106,7 @@ public abstract class ShortBuffer extends Buffer return this; } - final public ShortBuffer put(short[] src, int offset, int length) + public ShortBuffer put (short[] src, int offset, int length) { for (int i = offset; i < offset + length; i++) put(src[i]); @@ -125,7 +131,7 @@ public abstract class ShortBuffer extends Buffer public final int arrayOffset() { - return 0; + return array_offset; } public int hashCode() @@ -173,17 +179,7 @@ public abstract class ShortBuffer extends Buffer return 0; } - public final ByteOrder order() - { - return endian; - } - - public final ShortBuffer order(ByteOrder bo) - { - endian = bo; - return this; - } - + public abstract ByteOrder order (); public abstract short get(); public abstract java.nio. ShortBuffer put(short b); public abstract short get(int index); @@ -193,34 +189,4 @@ public abstract class ShortBuffer extends Buffer public abstract ShortBuffer slice(); public abstract ShortBuffer duplicate(); public abstract ShortBuffer asReadOnlyBuffer(); - public abstract ShortBuffer asShortBuffer(); - public abstract CharBuffer asCharBuffer(); - public abstract IntBuffer asIntBuffer(); - public abstract LongBuffer asLongBuffer(); - public abstract FloatBuffer asFloatBuffer(); - public abstract DoubleBuffer asDoubleBuffer(); - public abstract char getChar(); - public abstract ShortBuffer putChar(char value); - public abstract char getChar(int index); - public abstract ShortBuffer putChar(int index, char value); - public abstract short getShort(); - public abstract ShortBuffer putShort(short value); - public abstract short getShort(int index); - public abstract ShortBuffer putShort(int index, short value); - public abstract int getInt(); - public abstract ShortBuffer putInt(int value); - public abstract int getInt(int index); - public abstract ShortBuffer putInt(int index, int value); - public abstract long getLong(); - public abstract ShortBuffer putLong(long value); - public abstract long getLong(int index); - public abstract ShortBuffer putLong(int index, long value); - public abstract float getFloat(); - public abstract ShortBuffer putFloat(float value); - public abstract float getFloat(int index); - public abstract ShortBuffer putFloat(int index, float value); - public abstract double getDouble(); - public abstract ShortBuffer putDouble(double value); - public abstract double getDouble(int index); - public abstract ShortBuffer putDouble(int index, double value); } -- cgit v1.1