public abstract class FeatureExtractor<R,P> extends Bead
process(net.beadsproject.beads.core.TimeStamp, net.beadsproject.beads.core.TimeStamp, P)
to process data.Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
featureDescriptions
An array of Strings providing descriptions of the feature data.
|
protected R |
features
The current feature data.
|
protected java.lang.String |
name
The name of the FeatureExtractor.
|
protected int |
numFeatures
The number of features.
|
Constructor and Description |
---|
FeatureExtractor()
Instantiates a new FeatureExtractor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(FeatureExtractor<?,R> listener)
Adds a FeatureExtractor to listen to this FeatureExtractor.
|
void |
forward(TimeStamp startTime,
TimeStamp endTime)
Subclasses should call this at end of their process() method to forward features to listeners.
|
java.lang.String[] |
getFeatureDescriptions()
Gets the feature descriptions.
|
R |
getFeatures()
Gets the current features of type R, specified in the class def.
|
java.lang.String |
getName()
Gets the name.
|
int |
getNumberOfFeatures()
Gets the number of features.
|
abstract void |
process(TimeStamp startTime,
TimeStamp endTime,
P data)
Process some data of type P (specified by the class def).
|
void |
removeListener(FeatureExtractor<?,R> listener)
Removes a FeatureExtractor from the list of listeners.
|
void |
setName(java.lang.String name)
Sets the name.
|
void |
setNumberOfFeatures(int numFeatures)
Sets the number of features.
|
getKillListener, isDeleted, isPaused, kill, message, messageReceived, pause, setKillListener, start, toString
protected int numFeatures
protected R features
protected java.lang.String name
protected java.lang.String[] featureDescriptions
public FeatureExtractor()
public abstract void process(TimeStamp startTime, TimeStamp endTime, P data)
data
- the data.public void forward(TimeStamp startTime, TimeStamp endTime)
public void addListener(FeatureExtractor<?,R> listener)
listener
- the FeatureExtractor that listens to this one.public void removeListener(FeatureExtractor<?,R> listener)
listener
- the FeatureExtractor to remove.public R getFeatures()
public int getNumberOfFeatures()
public void setNumberOfFeatures(int numFeatures)
numFeatures
- the new number of features.public void setName(java.lang.String name)
public java.lang.String getName()
public java.lang.String[] getFeatureDescriptions()