org.jocl.cloth
Class SimpleFloatBufferHandle

java.lang.Object
  extended by org.jocl.cloth.SimpleFloatBufferHandle
All Implemented Interfaces:
ResourceHandle<java.nio.FloatBuffer>

 class SimpleFloatBufferHandle
extends java.lang.Object
implements ResourceHandle<java.nio.FloatBuffer>

A ResourceHandle that obtains the FloatBuffer by wrapping an array


Constructor Summary
SimpleFloatBufferHandle(float[] array)
          Creates a new float buffer source that provides a buffer that wraps the given array
 
Method Summary
 void acquire()
          Has to be called before the resource may be obtained
 java.nio.FloatBuffer get()
          Returns the resource from this handle.
 void release()
          Has to be called as soon as the resource is not used any more
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleFloatBufferHandle

SimpleFloatBufferHandle(float[] array)
Creates a new float buffer source that provides a buffer that wraps the given array

Parameters:
array - The array
Method Detail

get

public java.nio.FloatBuffer get()
Description copied from interface: ResourceHandle
Returns the resource from this handle. Note that this resource may only be valid between calls to ResourceHandle.acquire() and ResourceHandle.release(). Clients should preferably not store the returned object, but always access the resource by calling this method. This method may return null if the resource has not properly been acquired.

Specified by:
get in interface ResourceHandle<java.nio.FloatBuffer>
Returns:
The resource

acquire

public void acquire()
Description copied from interface: ResourceHandle
Has to be called before the resource may be obtained

Specified by:
acquire in interface ResourceHandle<java.nio.FloatBuffer>

release

public void release()
Description copied from interface: ResourceHandle
Has to be called as soon as the resource is not used any more

Specified by:
release in interface ResourceHandle<java.nio.FloatBuffer>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object