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 TypeMethodDescriptionvoid
dump
(PrintWriter output, int pad, String title) Dumps the FeatureSet in textual form.void
dump
(PrintWriter output, int pad, String title, boolean showName) Dumps the FeatureSet in textual form.float
Convenience method that returns the named feature as a float.int
Convenience 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.boolean
Determines if the given feature is present.void
Removes the named feature from this set of features.void
Convenience method that sets the named feature as a float.void
Convenience method that sets the named feature as a int.void
Sets the named feature.void
Convenience 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:
isPresent
in 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:
remove
in interfaceFeatureSet
- Parameters:
name
- the name of the feature of interest
-
getString
Convenience method that returns the named feature as a string.- Specified by:
getString
in 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:
getInt
in 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:
getFloat
in 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:
getObject
in 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:
setInt
in 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:
setFloat
in 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:
setString
in interfaceFeatureSet
- Parameters:
name
- the name of the featurevalue
- the value of the feature
-
setObject
Sets the named feature.- Specified by:
setObject
in 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:
dump
in interfaceDumpable
- Specified by:
dump
in 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
-