Class FloatCollector
- java.lang.Object
-
- com.tagtraum.jipes.AbstractSignalProcessor<Float,float[]>
-
- com.tagtraum.audiokern.audioprocessor.FloatCollector
-
- All Implemented Interfaces:
SignalProcessor<Float,float[]>
,SignalPullProcessor<Float,float[]>
,SignalSource<float[]>
public class FloatCollector extends AbstractSignalProcessor<Float,float[]>
Collects Floats in a float array. If you'd like to use this class, but only have a more complex object to work with, use aAggregate
to convert your complex object to a float before using this collector.
In push mode, downstream processors are handed the array whenflush()
is called. Suitable downstream processors includeAggregate
.
In pull mode, the upstream generator is read completely, its elements are converted to floats and collected in an array that is then returned whenread()
is called.- Author:
- Hendrik Schreiber
- See Also:
ListCollector
,Aggregate
-
-
Field Summary
-
Fields inherited from class com.tagtraum.jipes.AbstractSignalProcessor
lastOut, signalProcessorSupport
-
-
Constructor Summary
Constructors Constructor Description FloatCollector()
FloatCollector(Object id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
float[]
getOutput()
void
process(Float element)
protected float[]
processNext(Float element)
float[]
read()
void
reset()
String
toString()
-
Methods inherited from class com.tagtraum.jipes.AbstractSignalProcessor
connectTo, connectTo, connectTo, disconnectFrom, getConnectedProcessors, getConnectedSource, getId, setId
-
-
-
-
Constructor Detail
-
FloatCollector
public FloatCollector()
-
FloatCollector
public FloatCollector(Object id)
-
-
Method Detail
-
processNext
protected float[] processNext(Float element) throws IOException
- Specified by:
processNext
in classAbstractSignalProcessor<Float,float[]>
- Throws:
IOException
-
reset
public void reset()
- Specified by:
reset
in interfaceSignalSource<float[]>
- Overrides:
reset
in classAbstractSignalProcessor<Float,float[]>
-
process
public void process(Float element) throws IOException
- Specified by:
process
in interfaceSignalProcessor<Float,float[]>
- Overrides:
process
in classAbstractSignalProcessor<Float,float[]>
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceSignalProcessor<Float,float[]>
- Overrides:
flush
in classAbstractSignalProcessor<Float,float[]>
- Throws:
IOException
-
getOutput
public float[] getOutput() throws IOException
- Specified by:
getOutput
in interfaceSignalProcessor<Float,float[]>
- Overrides:
getOutput
in classAbstractSignalProcessor<Float,float[]>
- Throws:
IOException
-
read
public float[] read() throws IOException
- Specified by:
read
in interfaceSignalSource<float[]>
- Overrides:
read
in classAbstractSignalProcessor<Float,float[]>
- Throws:
IOException
-
-