Package com.sun.speech.freetts
Interface FeatureSet
- All Superinterfaces:
Dumpable
- All Known Implementing Classes:
FeatureSetImpl,Utterance
Represents the abstract interface to an entity that has
a set of features. Provides interfaces to set and get the name/value
pairs as well as providing a set of convenience methods for
setting and retrieving values of a particular type.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintWriter output, int pad, String title) Dumps the FeatureSet in textual form.floatConvenience method that returns the named feature as a float.intConvenience method that returns the named feature as an int.Returns the named feature as an object.Convenience method that returns the named feature as a string.booleanDetermines if the given feature is present.voidRemoves the named feature from this set of features.voidConvenience method that sets the named feature as a floatvoidConvenience method that sets the named feature as an int.voidSets the named feature .voidConvenience method that sets the named feature as a String.
-
Method Details
-
isPresent
Determines if the given feature is present.- Parameters:
name- the name of the feature of interest- Returns:
- true if the named feature is present
-
remove
Removes the named feature from this set of features.- Parameters:
name- the name of the feature of interest
-
getString
Convenience method that returns the named feature as a string.- Parameters:
name- the name of the feature- Returns:
- the value associated with the name or null if the value is not found
- Throws:
ClassCastException- if theassociated value is not a String
-
getInt
Convenience method that returns the named feature as an int.- Parameters:
name- the name of the feature- Returns:
- the value associated with the name or null if the value is not found
- Throws:
ClassCastException- if the associated value is not an int
-
getFloat
Convenience method that returns the named feature as a float.- Parameters:
name- the name of the feature- Returns:
- the value associated with the name or null if the value is not found
- Throws:
ClassCastException- if the associated value is not a float.
-
getObject
Returns the named feature as an object.- Parameters:
name- the name of the feature- Returns:
- the value associated with the name or null if the value is not found
-
setInt
Convenience method that sets the named feature as an int.- Parameters:
name- the name of the featurevalue- the value of the feature
-
setFloat
Convenience method that sets the named feature as a float- Parameters:
name- the name of the featurevalue- the value of the feature
-
setString
Convenience method that sets the named feature as a String.- Parameters:
name- the name of the featurevalue- the value of the feature
-
setObject
Sets the named feature .- Parameters:
name- the name of the featurevalue- the value of the feature
-
dump
Dumps the FeatureSet in textual form.
-