|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.frontend.BaseDataProcessor
edu.cmu.sphinx.frontend.databranch.DataBufferProcessor
public class DataBufferProcessor
A FIFO-buffer for Data
-elements.
Data
s are inserted to the buffer using the processDataFrame
-method.
Field Summary | |
---|---|
static java.lang.String |
DATA_LISTENERS
|
static java.lang.String |
PROP_BUFFER_SIZE
The maximal size of the buffer in frames. |
static java.lang.String |
PROP_WAIT_IF_EMPTY
If this property is set true the buffer will wait for new data until it returns from a
getData -call. |
static java.lang.String |
PROP_WAIT_TIME_MS
The time in milliseconds which will be waited between two attemtps to read a data-lement from the buffer when being in waitIfEmpty -mode |
Constructor Summary | |
---|---|
DataBufferProcessor()
|
Method Summary | |
---|---|
void |
addDataListener(DataListener l)
Adds a new listener. |
void |
clearBuffer()
|
java.util.List<Data> |
getBuffer()
|
int |
getBufferSize()
|
Data |
getData()
Returns the processed Data output. |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured. |
void |
processDataFrame(Data data)
This method is invoked when a new Data object becomes available. |
void |
removeDataListener(DataListener l)
Removes a listener. |
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor |
---|
getPredecessor, getTimer, initialize, setPredecessor, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_WAIT_IF_EMPTY
true
the buffer will wait for new data until it returns from a
getData
-call. Enable this flag if the buffer should serve as starting point for a new
feature-pull-chain..
@S4Integer(defaultValue=10) public static final java.lang.String PROP_WAIT_TIME_MS
waitIfEmpty
-mode
@S4Integer(defaultValue=50000) public static final java.lang.String PROP_BUFFER_SIZE
@S4ComponentList(type=Configurable.class, beTolerant=true) public static final java.lang.String DATA_LISTENERS
Constructor Detail |
---|
public DataBufferProcessor()
Method Detail |
---|
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class BaseDataProcessor
ps
- a property sheet holding the new data
PropertyException
- if there is a problem with the properties.public void processDataFrame(Data data)
DataListener
Data
object becomes available.
processDataFrame
in interface DataListener
public Data getData() throws DataProcessingException
getData
in interface DataProcessor
getData
in class BaseDataProcessor
DataProcessingException
- if a data processor error occurspublic int getBufferSize()
public void clearBuffer()
public java.util.List<Data> getBuffer()
public void addDataListener(DataListener l)
public void removeDataListener(DataListener l)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |