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; |
import java.nio.FloatBuffer; |
44 |
|
import java.nio.IntBuffer; |
45 |
|
import java.nio.LongBuffer; |
46 |
|
import java.nio.ShortBuffer; |
47 |
|
|
48 |
public final class FloatBufferImpl extends FloatBuffer |
public final class FloatBufferImpl extends FloatBuffer |
49 |
{ |
{ |
87 |
private static native float[] nio_cast(float[]copy); |
private static native float[] nio_cast(float[]copy); |
88 |
private static native float[] nio_cast(double[]copy); |
private static native float[] nio_cast(double[]copy); |
89 |
|
|
90 |
FloatBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(FloatBufferImpl b, int index, int limit); private static native void nio_put_Byte(FloatBufferImpl 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; } |
FloatBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(FloatBufferImpl b, int index, int limit); private static native void nio_put_Byte(FloatBufferImpl b, int index, int limit, byte value); public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/4); return res; } |
91 |
FloatBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(FloatBufferImpl b, int index, int limit); private static native void nio_put_Char(FloatBufferImpl 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; } |
FloatBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(FloatBufferImpl b, int index, int limit); private static native void nio_put_Char(FloatBufferImpl b, int index, int limit, char value); public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; } |
92 |
FloatBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(FloatBufferImpl b, int index, int limit); private static native void nio_put_Short(FloatBufferImpl 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; } |
FloatBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(FloatBufferImpl b, int index, int limit); private static native void nio_put_Short(FloatBufferImpl b, int index, int limit, short value); public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; } |
93 |
FloatBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(FloatBufferImpl b, int index, int limit); private static native void nio_put_Int(FloatBufferImpl 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; } |
FloatBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(FloatBufferImpl b, int index, int limit); private static native void nio_put_Int(FloatBufferImpl b, int index, int limit, int value); public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; } |
94 |
FloatBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(FloatBufferImpl b, int index, int limit); private static native void nio_put_Long(FloatBufferImpl 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; } |
FloatBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(FloatBufferImpl b, int index, int limit); private static native void nio_put_Long(FloatBufferImpl b, int index, int limit, long value); public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; } |
95 |
FloatBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(FloatBufferImpl b, int index, int limit); private static native void nio_put_Float(FloatBufferImpl 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; } |
FloatBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(FloatBufferImpl b, int index, int limit); private static native void nio_put_Float(FloatBufferImpl b, int index, int limit, float value); public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; } |
96 |
FloatBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(FloatBufferImpl b, int index, int limit); private static native void nio_put_Double(FloatBufferImpl 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; } |
FloatBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(FloatBufferImpl b, int index, int limit); private static native void nio_put_Double(FloatBufferImpl 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. FloatBuffer slice() |
public FloatBuffer slice() |
104 |
{ |
{ |
105 |
FloatBufferImpl A = new FloatBufferImpl(this); |
FloatBufferImpl A = new FloatBufferImpl(this); |
106 |
A.array_offset = position(); |
A.array_offset = position(); |
107 |
return A; |
return A; |
108 |
} |
} |
109 |
|
|
110 |
public java.nio. FloatBuffer duplicate() |
public FloatBuffer duplicate() |
111 |
{ |
{ |
112 |
return new FloatBufferImpl(this); |
return new FloatBufferImpl(this); |
113 |
} |
} |
114 |
|
|
115 |
public java.nio. FloatBuffer asReadOnlyBuffer() |
public FloatBuffer asReadOnlyBuffer() |
116 |
{ |
{ |
117 |
FloatBufferImpl a = new FloatBufferImpl(this); |
FloatBufferImpl a = new FloatBufferImpl(this); |
118 |
a.ro = true; |
a.ro = true; |
119 |
return a; |
return a; |
120 |
} |
} |
121 |
|
|
122 |
public java.nio. FloatBuffer compact() |
public FloatBuffer compact() |
123 |
{ |
{ |
124 |
return this; |
return this; |
125 |
} |
} |
136 |
return e; |
return e; |
137 |
} |
} |
138 |
|
|
139 |
final public java.nio. FloatBuffer put(float b) |
final public FloatBuffer put(float b) |
140 |
{ |
{ |
141 |
backing_buffer[position()] = b; |
backing_buffer[position()] = b; |
142 |
position(position()+1); |
position(position()+1); |
148 |
return backing_buffer[index]; |
return backing_buffer[index]; |
149 |
} |
} |
150 |
|
|
151 |
final public java.nio. FloatBuffer put(int index, float b) |
final public FloatBuffer put(int index, float 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. FloatBuffer 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. FloatBuffer 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 FloatBuffer 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 FloatBuffer 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. FloatBuffer 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. FloatBuffer 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 FloatBuffer 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 FloatBuffer putShort(int index, short value) { nio_put_Short(this, index, limit(), value); return this; }; |
159 |
final public int getInt() { int a = nio_get_Int(this, position(), limit()); inc_pos(4); return a; } final public java.nio. FloatBuffer 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. FloatBuffer 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 FloatBuffer 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 FloatBuffer putInt(int index, int value) { nio_put_Int(this, index, limit(), value); return this; }; |
160 |
final public long getLong() { long a = nio_get_Long(this, position(), limit()); inc_pos(8); return a; } final public java.nio. FloatBuffer 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. FloatBuffer 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 FloatBuffer 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 FloatBuffer putLong(int index, long value) { nio_put_Long(this, index, limit(), value); return this; }; |
161 |
final public float getFloat() { return get(); } final public java.nio. FloatBuffer putFloat(float value) { return put(value); } final public float getFloat(int index) { return get(index); } final public java.nio. FloatBuffer putFloat(int index, float value) { return put(index, value); }; |
final public float getFloat() { return get(); } final public FloatBuffer putFloat(float value) { return put(value); } final public float getFloat(int index) { return get(index); } final public FloatBuffer putFloat(int index, float value) { return put(index, value); }; |
162 |
final public double getDouble() { double a = nio_get_Double(this, position(), limit()); inc_pos(8); return a; } final public java.nio. FloatBuffer 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. FloatBuffer 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 FloatBuffer 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 FloatBuffer putDouble(int index, double value) { nio_put_Double(this, index, limit(), value); return this; }; |
163 |
} |
} |