SAMPLE - the generic typepublic abstract class RawDataSampleBuffer<SAMPLE> extends java.lang.Object implements ConnectionEventListener
ConnectionEventListener to the AbstractMultiConnectionSocket.| Modifier | Constructor and Description |
|---|---|
protected |
RawDataSampleBuffer(int bufferSize,
int fftSize)
Instantiates a new raw data sample buffer.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addSample(SAMPLE sample)
Adds the sample.
|
protected void |
addSampleImpl(double... sample)
Adds the sample impl.
|
void |
clear()
Clear.
|
void |
connectionEventPerformed(ConnectionEvent e)
Implementation starts/stops disruptor.
|
int |
getBufferSize()
Gets the buffer size.
|
int |
getFftSize()
Gets the fft size.
|
double[] |
getSnapshot()
Gets the snapshot.
|
void |
setBufferSize(int bufferSize)
Sets the buffer size.
|
void |
setFftSize(int fftSize)
Sets the fft size.
|
void |
stopTuning()
Invoked after a period of time after invoking tune().
|
void |
tune()
When invoked the number of samples will be counted.
|
protected RawDataSampleBuffer(int bufferSize,
int fftSize)
bufferSize - the buffer sizefftSize - the fft sizepublic void connectionEventPerformed(ConnectionEvent e)
connectionEventPerformed in interface ConnectionEventListenere - the epublic abstract void addSample(SAMPLE sample)
sample - the sampleprotected void addSampleImpl(double... sample)
sample - the samplepublic double[] getSnapshot()
public void clear()
public void tune()
stopTuning() is invoked the time taken to process the total number
of samples taken during that time will be used to resize the sample buffer.public void stopTuning()
public int getBufferSize()
public void setBufferSize(int bufferSize)
bufferSize - the new buffer sizepublic int getFftSize()
public void setFftSize(int fftSize)
fftSize - the new fft size