|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cmu.sphinx.util.props.ConfigurableAdapter
edu.cmu.sphinx.frontend.BaseDataProcessor
edu.cmu.sphinx.frontend.databranch.DataBufferProcessor
public class DataBufferProcessor
A FIFO-buffer for Data-elements.
Datas 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 attempts to read a data element from the buffer when being in waitIfEmpty-mode |
| Constructor Summary | |
|---|---|
DataBufferProcessor()
|
|
DataBufferProcessor(int maxBufferSize,
boolean waitIfEmpty,
int waitTime,
java.util.List<? extends Configurable> listeners)
|
|
| 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 |
| Methods inherited from class edu.cmu.sphinx.util.props.ConfigurableAdapter |
|---|
getName, 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(int maxBufferSize,
boolean waitIfEmpty,
int waitTime,
java.util.List<? extends Configurable> listeners)
maxBufferSize - The maximal size of the buffer in frames. The oldest frames will be removed if the buffer grows out of bounds.waitIfEmpty - If this property is set 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.waitTime - The time in milliseconds which will be waited between two attempts to read a data element from the buffer when
being in waitIfEmpty-modelisteners - public DataBufferProcessor()
| Method Detail |
|---|
public void newProperties(PropertySheet ps)
throws PropertyException
Configurable
newProperties in interface ConfigurablenewProperties in class ConfigurableAdapterps - a property sheet holding the new data
PropertyException - if there is a problem with the properties.public void processDataFrame(Data data)
DataListenerData object becomes available.
processDataFrame in interface DataListener
public Data getData()
throws DataProcessingException
getData in interface DataProcessorgetData in class BaseDataProcessorDataProcessingException - if a data processor error occurspublic int getBufferSize()
public void clearBuffer()
public java.util.List<Data> getBuffer()
public void addDataListener(DataListener l)
l - public void removeDataListener(DataListener l)
l -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||