/[classpath]/classpath/gnu/java/nio/IntBufferImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/IntBufferImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by mkoch, Sun Nov 17 12:21:36 2002 UTC revision 1.9 by mkoch, Tue Nov 19 11:21:34 2002 UTC
# Line 37  exception statement from your version. * Line 37  exception statement from your version. *
37    
38  package gnu.java.nio;  package gnu.java.nio;
39    
40    import java.nio.ByteBuffer;
41    import java.nio.CharBuffer;
42    import java.nio.DoubleBuffer;
43    import java.nio.FloatBuffer;
44  import java.nio.IntBuffer;  import java.nio.IntBuffer;
45    import java.nio.LongBuffer;
46    import java.nio.ShortBuffer;
47    
48  public final class IntBufferImpl extends IntBuffer  public final class IntBufferImpl extends IntBuffer
49  {  {
# Line 81  public final class IntBufferImpl extends Line 87  public final class IntBufferImpl extends
87    private static native int[] nio_cast(float[]copy);    private static native int[] nio_cast(float[]copy);
88    private static native int[] nio_cast(double[]copy);    private static native int[] nio_cast(double[]copy);
89    
90    IntBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(IntBufferImpl b, int index, int limit); private static native void nio_put_Byte(IntBufferImpl b, int index, int limit, byte value); public java.nio. ByteBuffer asByteBuffer() { gnu.java.nio. ByteBufferImpl res = new gnu.java.nio. ByteBufferImpl(backing_buffer); res.limit((limit()*1)/4); return res; }    IntBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(IntBufferImpl b, int index, int limit); private static native void nio_put_Byte(IntBufferImpl b, int index, int limit, byte value); public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/4); return res; }
91    IntBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(IntBufferImpl b, int index, int limit); private static native void nio_put_Char(IntBufferImpl b, int index, int limit, char value); public java.nio. CharBuffer asCharBuffer() { gnu.java.nio. CharBufferImpl res = new gnu.java.nio. CharBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }    IntBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(IntBufferImpl b, int index, int limit); private static native void nio_put_Char(IntBufferImpl b, int index, int limit, char value); public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }
92    IntBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(IntBufferImpl b, int index, int limit); private static native void nio_put_Short(IntBufferImpl b, int index, int limit, short value); public java.nio. ShortBuffer asShortBuffer() { gnu.java.nio. ShortBufferImpl res = new gnu.java.nio. ShortBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }    IntBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(IntBufferImpl b, int index, int limit); private static native void nio_put_Short(IntBufferImpl b, int index, int limit, short value); public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }
93    IntBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(IntBufferImpl b, int index, int limit); private static native void nio_put_Int(IntBufferImpl b, int index, int limit, int value); public java.nio. IntBuffer asIntBuffer() { gnu.java.nio. IntBufferImpl res = new gnu.java.nio. IntBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }    IntBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(IntBufferImpl b, int index, int limit); private static native void nio_put_Int(IntBufferImpl b, int index, int limit, int value); public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }
94    IntBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(IntBufferImpl b, int index, int limit); private static native void nio_put_Long(IntBufferImpl b, int index, int limit, long value); public java.nio. LongBuffer asLongBuffer() { gnu.java.nio. LongBufferImpl res = new gnu.java.nio. LongBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }    IntBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(IntBufferImpl b, int index, int limit); private static native void nio_put_Long(IntBufferImpl b, int index, int limit, long value); public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }
95    IntBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(IntBufferImpl b, int index, int limit); private static native void nio_put_Float(IntBufferImpl b, int index, int limit, float value); public java.nio. FloatBuffer asFloatBuffer() { gnu.java.nio. FloatBufferImpl res = new gnu.java.nio. FloatBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }    IntBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(IntBufferImpl b, int index, int limit); private static native void nio_put_Float(IntBufferImpl b, int index, int limit, float value); public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }
96    IntBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(IntBufferImpl b, int index, int limit); private static native void nio_put_Double(IntBufferImpl b, int index, int limit, double value); public java.nio. DoubleBuffer asDoubleBuffer() { gnu.java.nio. DoubleBufferImpl res = new gnu.java.nio. DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }    IntBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(IntBufferImpl b, int index, int limit); private static native void nio_put_Double(IntBufferImpl b, int index, int limit, double value); public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }
97    
98    public boolean isReadOnly()    public boolean isReadOnly()
99    {    {
100      return ro;      return ro;
101    }    }
102    
103    public java.nio. IntBuffer slice()    public IntBuffer slice()
104    {    {
105      IntBufferImpl A = new IntBufferImpl(this);      IntBufferImpl A = new IntBufferImpl(this);
106      A.array_offset = position();      A.array_offset = position();
107      return A;      return A;
108    }    }
109    
110    public java.nio. IntBuffer duplicate()    public IntBuffer duplicate()
111    {    {
112      return new IntBufferImpl(this);      return new IntBufferImpl(this);
113    }    }
114    
115    public java.nio. IntBuffer asReadOnlyBuffer()    public IntBuffer asReadOnlyBuffer()
116    {    {
117      IntBufferImpl a = new IntBufferImpl(this);      IntBufferImpl a = new IntBufferImpl(this);
118      a.ro = true;      a.ro = true;
119      return a;      return a;
120    }    }
121    
122    public java.nio. IntBuffer compact()    public IntBuffer compact()
123    {    {
124      return this;      return this;
125    }    }
# Line 130  public final class IntBufferImpl extends Line 136  public final class IntBufferImpl extends
136      return e;      return e;
137    }    }
138    
139    final public java.nio. IntBuffer put(int b)    final public IntBuffer put(int b)
140    {    {
141      backing_buffer[position()] = b;      backing_buffer[position()] = b;
142      position(position()+1);      position(position()+1);
# Line 142  public final class IntBufferImpl extends Line 148  public final class IntBufferImpl extends
148      return backing_buffer[index];      return backing_buffer[index];
149    }    }
150    
151    final public java.nio. IntBuffer put(int index, int b)    final public IntBuffer put(int index, int b)
152    {    {
153      backing_buffer[index] = b;      backing_buffer[index] = b;
154      return this;      return this;
155    }    }
156    
157    final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public java.nio. IntBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public java.nio. IntBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };    final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public IntBuffer putChar(char value) { nio_put_Char(this, position(), limit(), value); inc_pos(2); return this; } final public char getChar(int index) { char a = nio_get_Char(this, index, limit()); return a; } final public IntBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
158    final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public java.nio. IntBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public java.nio. IntBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };    final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public IntBuffer putShort(short value) { nio_put_Short(this, position(), limit(), value); inc_pos(2); return this; } final public short getShort(int index) { short a = nio_get_Short(this, index, limit()); return a; } final public IntBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
159    final public int getInt() { return get(); } final public java.nio. IntBuffer putInt(int value) { return put(value); } final public int getInt(int index) { return get(index); } final public java.nio. IntBuffer putInt(int index, int value) { return put(index, value); };    final public int getInt() { return get(); } final public IntBuffer putInt(int value) { return put(value); } final public int getInt(int index) { return get(index); } final public IntBuffer putInt(int index, int value) { return put(index, value); };
160    final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public java.nio. IntBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public java.nio. IntBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };    final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public IntBuffer putLong(long value) { nio_put_Long(this, position(), limit(), value); inc_pos(8); return this; } final public long getLong(int index) { long a = nio_get_Long(this, index, limit()); return a; } final public IntBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
161    final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public java.nio. IntBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public java.nio. IntBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };    final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public IntBuffer putFloat(float value) { nio_put_Float(this, position(), limit(), value); inc_pos(4); return this; } final public float getFloat(int index) { float a = nio_get_Float(this, index, limit()); return a; } final public IntBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
162    final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public java.nio. IntBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public java.nio. IntBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };    final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public IntBuffer putDouble(double value) { nio_put_Double(this, position(), limit(), value); inc_pos(8); return this; } final public double getDouble(int index) { double a = nio_get_Double(this, index, limit()); return a; } final public IntBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; };
163  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26