Commit 681979f0 by Michael Koch Committed by Michael Koch

2003-02-19 Michael Koch <konqueror@gmx.de>

	* gnu/java/nio/ByteBufferImpl.java
	(ByteBufferImpl): Renamed two variables.
	* gnu/java/nio/CharBufferImpl.java
	(CharBufferImpl): Renamed two variables.
	* gnu/java/nio/DoubleBufferImpl.java
	(DoubleBufferImpl): Renamed two variables.
	* gnu/java/nio/FloatBufferImpl.java
	(FloatBufferImpl): Renamed two variables.
	* gnu/java/nio/IntBufferImpl.java
	(IntBufferImpl): Renamed two variables.
	* gnu/java/nio/LongBufferImpl.java
	(LongBufferImpl): Renamed two variables.
	* gnu/java/nio/ShortBufferImpl.java
	(ShortBufferImpl): Renamed two variables.
	* java/nio/CharBuffer.java
	(wrap): Fixed arguments to CharBufferImpl constructor.
	(hasArray): Only not read-only buffers have backing arrays.
	(length): Documentation added.
	(subSequence): Documentation added.
	* java/nio/DoubleBuffer.java
	(hasArray): Only not read-only buffers have backing arrays.
	* java/nio/FloatBuffer.java
	(hasArray): Only not read-only buffers have backing arrays.
	* java/nio/IntBuffer.java
	(hasArray): Only not read-only buffers have backing arrays.
	* java/nio/LongBuffer.java
	(hasArray): Only not read-only buffers have backing arrays.
	* java/nio/ShortBuffer.java
	(hasArray): Only not read-only buffers have backing arrays.

From-SVN: r63101
parent 0887aae1
2003-02-19 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/ByteBufferImpl.java
(ByteBufferImpl): Renamed two variables.
* gnu/java/nio/CharBufferImpl.java
(CharBufferImpl): Renamed two variables.
* gnu/java/nio/DoubleBufferImpl.java
(DoubleBufferImpl): Renamed two variables.
* gnu/java/nio/FloatBufferImpl.java
(FloatBufferImpl): Renamed two variables.
* gnu/java/nio/IntBufferImpl.java
(IntBufferImpl): Renamed two variables.
* gnu/java/nio/LongBufferImpl.java
(LongBufferImpl): Renamed two variables.
* gnu/java/nio/ShortBufferImpl.java
(ShortBufferImpl): Renamed two variables.
* java/nio/CharBuffer.java
(wrap): Fixed arguments to CharBufferImpl constructor.
(hasArray): Only not read-only buffers have backing arrays.
(length): Documentation added.
(subSequence): Documentation added.
* java/nio/DoubleBuffer.java
(hasArray): Only not read-only buffers have backing arrays.
* java/nio/FloatBuffer.java
(hasArray): Only not read-only buffers have backing arrays.
* java/nio/IntBuffer.java
(hasArray): Only not read-only buffers have backing arrays.
* java/nio/LongBuffer.java
(hasArray): Only not read-only buffers have backing arrays.
* java/nio/ShortBuffer.java
(hasArray): Only not read-only buffers have backing arrays.
2003-02-19 Michael Koch <konqueror@gmx.de>
* javax/accessibility/AccessibleContext.java
(ACCESSIBLE_DESCRIPTION_PROPERTY): Fixed typo.
......
......@@ -60,9 +60,9 @@ public final class ByteBufferImpl extends ByteBuffer
readOnly = false;
}
public ByteBufferImpl (byte[] array, int off, int lim)
public ByteBufferImpl (byte[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -56,9 +56,9 @@ public final class CharBufferImpl extends CharBuffer
readOnly = false;
}
public CharBufferImpl(char[] array, int off, int lim)
public CharBufferImpl(char[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -56,9 +56,9 @@ public final class DoubleBufferImpl extends DoubleBuffer
readOnly = false;
}
public DoubleBufferImpl(double[] array, int off, int lim)
public DoubleBufferImpl(double[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -56,9 +56,9 @@ public final class FloatBufferImpl extends FloatBuffer
readOnly = false;
}
public FloatBufferImpl(float[] array, int off, int lim)
public FloatBufferImpl(float[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -56,9 +56,9 @@ public final class IntBufferImpl extends IntBuffer
readOnly = false;
}
public IntBufferImpl(int[] array, int off, int lim)
public IntBufferImpl(int[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -56,9 +56,9 @@ public final class LongBufferImpl extends LongBuffer
readOnly = false;
}
public LongBufferImpl(long[] array, int off, int lim)
public LongBufferImpl(long[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -56,9 +56,9 @@ public final class ShortBufferImpl extends ShortBuffer
readOnly = false;
}
public ShortBufferImpl(short[] array, int off, int lim)
public ShortBufferImpl(short[] array, int offset, int length)
{
super (array.length, lim, off, 0);
super (array.length, length, offset, 0);
this.backing_buffer = array;
readOnly = false;
}
......
......@@ -63,7 +63,7 @@ public abstract class CharBuffer extends Buffer
*/
final public static CharBuffer wrap (char[] array, int offset, int length)
{
return new CharBufferImpl (array, offset, offset + length);
return new CharBufferImpl (array, offset, length);
}
/**
......@@ -205,7 +205,8 @@ public abstract class CharBuffer extends Buffer
*/
public final boolean hasArray ()
{
return backing_buffer != null;
return (backing_buffer != null
&& ! isReadOnly ());
}
/**
......@@ -359,6 +360,9 @@ public abstract class CharBuffer extends Buffer
return new String (array (), position (), length ());
}
/**
* Returns the length of the remaining chars in this buffer.
*/
public final int length ()
{
return remaining ();
......@@ -370,6 +374,9 @@ public abstract class CharBuffer extends Buffer
public abstract ByteOrder order ();
/**
* Creates a new character buffer that represents the specified subsequence
* of this buffer, relative to the current position.
*
* @exception IndexOutOfBoundsException If the preconditions on start and
* end do not hold.
*/
......
......@@ -120,7 +120,8 @@ public abstract class DoubleBuffer extends Buffer implements Comparable
public final boolean hasArray()
{
return (backing_buffer != null);
return (backing_buffer != null
&& !isReadOnly ());
}
public final double[] array()
......
......@@ -121,7 +121,8 @@ public abstract class FloatBuffer extends Buffer implements Comparable
public final boolean hasArray()
{
return (backing_buffer != null);
return (backing_buffer != null
&& !isReadOnly ());
}
public final float[] array()
......
......@@ -121,7 +121,8 @@ public abstract class IntBuffer extends Buffer implements Comparable
public final boolean hasArray()
{
return (backing_buffer != null);
return (backing_buffer != null
&& !isReadOnly ());
}
public final int[] array()
......
......@@ -121,7 +121,8 @@ public abstract class LongBuffer extends Buffer implements Comparable
public final boolean hasArray()
{
return (backing_buffer != null);
return (backing_buffer != null
&& !isReadOnly ());
}
public final long[] array()
......
......@@ -121,7 +121,8 @@ public abstract class ShortBuffer extends Buffer implements Comparable
public final boolean hasArray()
{
return (backing_buffer != null);
return (backing_buffer != null
&& !isReadOnly ());
}
public final short[] array()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment