FileDocCategorySizeDatePackage
FloatBufferImpl.javaAPI DocphoneME MR2 API (J2ME)3456Wed May 02 18:00:48 BST 2007java.nio

FloatBufferImpl

public class FloatBufferImpl extends FloatBuffer
A Buffer storing float data.

Fields Summary
Constructors Summary
FloatBufferImpl(ByteBufferImpl parent, int capacity, float[] array, int arrayOffset, boolean isDirect)

        this.parent = parent;
	this.isDirect = isDirect;
	this.array = array;
	this.arrayOffset = arrayOffset;
	this.capacity = this.limit = capacity;
	this.position = 0;
    
Methods Summary
public voiddispose()

        // Need revisit
        this.disposed = true;
    
public floatget()

        if (position >= limit) {
            throw new BufferUnderflowException();
        }
	return get(position++);
    
public floatget(int index)

        if (index < 0 || index >= limit) {
            throw new IndexOutOfBoundsException();
        }

        int bytePtr = arrayOffset + (index << 2);
	if (isDirect) {
	    return ByteBufferImpl._getFloat(bytePtr);
	} else if (array != null) {
	   return array[arrayOffset + index]; 
	} else {
            return parent.getFloat(bytePtr);
	}
    
public booleanisDirect()

	return isDirect;
    
public intnativeAddress()

	return arrayOffset;
    
public java.nio.FloatBufferput(float f)

        if (position >= limit) {
            throw new BufferOverflowException();
        }
	return put(position++, f);
    
public java.nio.FloatBufferput(int index, float f)

        if (index < 0 || index >= limit) {
            throw new IndexOutOfBoundsException();
        }

        int bytePtr = arrayOffset + (index << 2);
	if (isDirect) {
	    ByteBufferImpl._putFloat(bytePtr, f);
	} else if (array != null) {
	    array[arrayOffset + index] = f;
	} else {
            parent.putFloat(bytePtr, f);
	}
	return this;
    
public java.nio.FloatBufferslice()

        int pos = position;
        if (isDirect) {
            pos <<= 2;
        }
        return new FloatBufferImpl(parent, limit - position, array,
                                   arrayOffset + pos,
                                   isDirect);