Package com.sun.speech.freetts
Class FeatureSetImpl
java.lang.Object
com.sun.speech.freetts.FeatureSetImpl
- All Implemented Interfaces:
Dumpable,FeatureSet
Implementation of the FeatureSet interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintWriter output, int pad, String title) Dumps the FeatureSet in textual form.voiddump(PrintWriter output, int pad, String title, boolean showName) Dumps the FeatureSet in textual form.floatConvenience method that returns the named feature as a float.intConvenience method that returns the named feature as a 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 float.voidConvenience method that sets the named feature as a int.voidSets the named feature.voidConvenience method that sets the named feature as a String.
-
Constructor Details
-
FeatureSetImpl
public FeatureSetImpl()Creates a new empty feature set
-
-
Method Details
-
isPresent
Determines if the given feature is present.- Specified by:
isPresentin interfaceFeatureSet- 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.- Specified by:
removein interfaceFeatureSet- Parameters:
name- the name of the feature of interest
-
getString
Convenience method that returns the named feature as a string.- Specified by:
getStringin interfaceFeatureSet- 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 String
-
getInt
Convenience method that returns the named feature as a int.- Specified by:
getIntin interfaceFeatureSet- 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.- Specified by:
getFloatin interfaceFeatureSet- 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.- Specified by:
getObjectin interfaceFeatureSet- 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 a int.- Specified by:
setIntin interfaceFeatureSet- Parameters:
name- the name of the featurevalue- the value of the feature
-
setFloat
Convenience method that sets the named feature as a float.- Specified by:
setFloatin interfaceFeatureSet- Parameters:
name- the name of the featurevalue- the value of the feature
-
setString
Convenience method that sets the named feature as a String.- Specified by:
setStringin interfaceFeatureSet- Parameters:
name- the name of the featurevalue- the value of the feature
-
setObject
Sets the named feature.- Specified by:
setObjectin interfaceFeatureSet- Parameters:
name- the name of the featurevalue- the value of the feature
-
dump
Dumps the FeatureSet in textual form. The feature name is not included in the dump.- Specified by:
dumpin interfaceDumpable- Specified by:
dumpin interfaceFeatureSet- Parameters:
output- where to send the formatted outputpad- the paddingtitle- the title
-
dump
Dumps the FeatureSet in textual form.- Parameters:
output- where to send the formatted outputpad- the paddingtitle- the titleshowName- iftrue, include the feature name
-