mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Refactoring to use COMPLEX and REAL sample terms throughout
This commit is contained in:
42
src/sample/real/RealBuffer.java
Normal file
42
src/sample/real/RealBuffer.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package sample.real;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class RealBuffer
|
||||
{
|
||||
private float[] mSamples;
|
||||
|
||||
/**
|
||||
* Wrapper around float array containing float samples
|
||||
*/
|
||||
public RealBuffer( float[] samples )
|
||||
{
|
||||
mSamples = samples;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a deep copy of the buffer
|
||||
*/
|
||||
public RealBuffer copyOf()
|
||||
{
|
||||
float[] copy = Arrays.copyOf( mSamples, mSamples.length );
|
||||
|
||||
return new RealBuffer( copy );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sample data
|
||||
*/
|
||||
public float[] getSamples()
|
||||
{
|
||||
return mSamples;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup method to nullify all data and references
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
mSamples = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user