net.beadsproject.beads.analysis
Class FeatureManager

java.lang.Object
  extended by net.beadsproject.beads.analysis.FeatureManager

public class FeatureManager
extends java.lang.Object

A static class for managing audio feature data. Features are stored in a Map indexed by the Samples they refer to. FeatureManager can look for feature files associated with Samples. A danger to be aware of is the fact that FeatureManager is not well coupled to SampleManager, so if you wish to remove Samples you'll have to make sure you also manually remove entries in FeatureManager, otherwise the Sample data will not be freed. This might be addressed in future versions.

Author:
ollie

Constructor Summary
FeatureManager()
           
 
Method Summary
static void featuresForGroup(java.lang.String groupName)
           
static FeatureSet featuresForSample(Sample sample)
          Gets the FeatureSet for a given Sample.
static FeatureSet featuresForSampleIfLoaded(Sample sample)
          Gets the FeatureSet for a given Sample, only if the FeatureSet is already stored in memory.
static boolean isVerbose()
          Determines if FeatureManager is being verbose.
static void removeSample(Sample s)
          Removes the features associated with the given Sample.
static void setFeaturesForSample(Sample s, FeatureSet fs)
          Sets the FeatureSet for the given Sample.
static void setVerbose(boolean verbose)
          Tells FeatureManager to produce verbose output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureManager

public FeatureManager()
Method Detail

setFeaturesForSample

public static void setFeaturesForSample(Sample s,
                                        FeatureSet fs)
Sets the FeatureSet for the given Sample.

Parameters:
s - the Sample.
fs - the FeatureSet.

featuresForSample

public static FeatureSet featuresForSample(Sample sample)
Gets the FeatureSet for a given Sample. The method first checks to see if the FeatureSet is already stored in memory. If not it looks for a file with the same file name as the Sample (including the file type), but with the suffix ".features". Once loaded, the FeatureSet is stored in memory.

Parameters:
sample - the Sample to search for features of.
Returns:
the FeatureSet.

featuresForSampleIfLoaded

public static FeatureSet featuresForSampleIfLoaded(Sample sample)
Gets the FeatureSet for a given Sample, only if the FeatureSet is already stored in memory.

Parameters:
sample - the Sample to search for features of.
Returns:
the FeatureSet.

featuresForGroup

public static void featuresForGroup(java.lang.String groupName)

removeSample

public static void removeSample(Sample s)
Removes the features associated with the given Sample.

Parameters:
s - the Sample.

isVerbose

public static boolean isVerbose()
Determines if FeatureManager is being verbose.

Returns:
true if verbose.

setVerbose

public static void setVerbose(boolean verbose)
Tells FeatureManager to produce verbose output.

Parameters:
verbose - true for verbose output.