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

Diff of /classpath/gnu/java/nio/DoubleBufferImpl.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;  import java.nio.DoubleBuffer;
43    import java.nio.FloatBuffer;
44    import java.nio.IntBuffer;
45    import java.nio.LongBuffer;
46    import java.nio.ShortBuffer;
47    
48  public final class DoubleBufferImpl extends DoubleBuffer  public final class DoubleBufferImpl extends DoubleBuffer
49  {  {
# Line 73  public final class DoubleBufferImpl exte Line 79  public final class DoubleBufferImpl exte
79      position(position() + a);      position(position() + a);
80    }    }
81        
82      DoubleBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Byte(DoubleBufferImpl b, int index, int limit, byte value); public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/8); return res; }
83      DoubleBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Char(DoubleBufferImpl b, int index, int limit, char value); public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/8); return res; }
84      DoubleBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Short(DoubleBufferImpl b, int index, int limit, short value); public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/8); return res; }
85      DoubleBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Int(DoubleBufferImpl b, int index, int limit, int value); public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/8); return res; }
86      DoubleBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Long(DoubleBufferImpl b, int index, int limit, long value); public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/8); return res; }
87      DoubleBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Float(DoubleBufferImpl b, int index, int limit, float value); public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/8); return res; }
88      DoubleBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Double(DoubleBufferImpl b, int index, int limit, double value); public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/8); return res; }
89    private static native double[] nio_cast(byte[]copy);    private static native double[] nio_cast(byte[]copy);
90    private static native double[] nio_cast(char[]copy);    private static native double[] nio_cast(char[]copy);
91    private static native double[] nio_cast(short[]copy);    private static native double[] nio_cast(short[]copy);
# Line 81  public final class DoubleBufferImpl exte Line 94  public final class DoubleBufferImpl exte
94    private static native double[] nio_cast(float[]copy);    private static native double[] nio_cast(float[]copy);
95    private static native double[] nio_cast(double[]copy);    private static native double[] nio_cast(double[]copy);
96    
   DoubleBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Byte(DoubleBufferImpl 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)/8); return res; }  
   DoubleBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Char(DoubleBufferImpl 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)/8); return res; }  
   DoubleBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Short(DoubleBufferImpl 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)/8); return res; }  
   DoubleBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Int(DoubleBufferImpl 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)/8); return res; }  
   DoubleBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Long(DoubleBufferImpl 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)/8); return res; }  
   DoubleBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Float(DoubleBufferImpl 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)/8); return res; }  
   DoubleBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(DoubleBufferImpl b, int index, int limit); private static native void nio_put_Double(DoubleBufferImpl 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)/8); return res; }  
   
97    public boolean isReadOnly()    public boolean isReadOnly()
98    {    {
99      return ro;      return ro;
100    }    }
101    
102    public java.nio. DoubleBuffer slice()    public DoubleBuffer slice()
103    {    {
104      DoubleBufferImpl A = new DoubleBufferImpl(this);      DoubleBufferImpl A = new DoubleBufferImpl(this);
105      A.array_offset = position();      A.array_offset = position();
106      return A;      return A;
107    }    }
108    
109    public java.nio. DoubleBuffer duplicate()    public DoubleBuffer duplicate()
110    {    {
111      return new DoubleBufferImpl(this);      return new DoubleBufferImpl(this);
112    }    }
113    
114    public java.nio. DoubleBuffer asReadOnlyBuffer()    public DoubleBuffer asReadOnlyBuffer()
115    {    {
116      DoubleBufferImpl a = new DoubleBufferImpl(this);      DoubleBufferImpl a = new DoubleBufferImpl(this);
117      a.ro = true;      a.ro = true;
118      return a;      return a;
119    }    }
120    
121    public java.nio. DoubleBuffer compact()    public DoubleBuffer compact()
122    {    {
123      return this;      return this;
124    }    }
# Line 130  public final class DoubleBufferImpl exte Line 135  public final class DoubleBufferImpl exte
135      return e;      return e;
136    }    }
137    
138    final public java.nio. DoubleBuffer put(double b)    final public DoubleBuffer put(double b)
139    {    {
140      backing_buffer[position()] = b;      backing_buffer[position()] = b;
141      position(position()+1);      position(position()+1);
# Line 142  public final class DoubleBufferImpl exte Line 147  public final class DoubleBufferImpl exte
147      return backing_buffer[index];      return backing_buffer[index];
148    }    }
149    
150    final public java.nio. DoubleBuffer put(int index, double b)    final public DoubleBuffer put(int index, double b)
151    {    {
152      backing_buffer[index] = b;      backing_buffer[index] = b;
153      return this;      return this;
154    }    }
155    
156    final public char getChar() { char a = nio_get_Char(this, position(), limit()); inc_pos(2); return a; } final public java.nio. DoubleBuffer 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. DoubleBuffer 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 DoubleBuffer 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 DoubleBuffer putChar(int index, char value) { nio_put_Char(this, index, limit(), value); return this; };
157    final public short getShort() { short a = nio_get_Short(this, position(), limit()); inc_pos(2); return a; } final public java.nio. DoubleBuffer 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. DoubleBuffer 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 DoubleBuffer 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 DoubleBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; };
158    final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public java.nio. DoubleBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public java.nio. DoubleBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };    final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public DoubleBuffer putInt(int value) { nio_put_Int(this, position(), limit(), value); inc_pos(4); return this; } final public int getInt(int index) { int a = nio_get_Int(this, index, limit()); return a; } final public DoubleBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; };
159    final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public java.nio. DoubleBuffer 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. DoubleBuffer 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 DoubleBuffer 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 DoubleBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; };
160    final public float getFloat() { float a = nio_get_Float(this, position(), limit()); inc_pos(4); return a; } final public java.nio. DoubleBuffer 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. DoubleBuffer 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 DoubleBuffer 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 DoubleBuffer putFloat(int index, float value) { nio_put_Float(this, index, limit(), value); return this; };
161    final public double getDouble() { return get(); } final public java.nio. DoubleBuffer putDouble(double value) { return put(value); } final public double getDouble(int index) { return get(index); } final public java.nio. DoubleBuffer putDouble(int index, double value) { return put(index, value); };    final public double getDouble() { return get(); } final public DoubleBuffer putDouble(double value) { return put(value); } final public double getDouble(int index) { return get(index); } final public DoubleBuffer putDouble(int index, double value) { return put(index, value); };
162  }  }

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