Package com.sun.speech.freetts
Class FeatureSetImpl
- java.lang.Object
-
- com.sun.speech.freetts.FeatureSetImpl
-
- All Implemented Interfaces:
Dumpable,FeatureSet
public class FeatureSetImpl extends java.lang.Object implements FeatureSet
Implementation of the FeatureSet interface.
-
-
Constructor Summary
Constructors Constructor Description FeatureSetImpl()Creates a new empty feature set
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.io.PrintWriter output, int pad, java.lang.String title)Dumps the FeatureSet in textual form.voiddump(java.io.PrintWriter output, int pad, java.lang.String title, boolean showName)Dumps the FeatureSet in textual form.floatgetFloat(java.lang.String name)Convenience method that returns the named feature as a float.intgetInt(java.lang.String name)Convenience method that returns the named feature as a int.java.lang.ObjectgetObject(java.lang.String name)Returns the named feature as an object.java.lang.StringgetString(java.lang.String name)Convenience method that returns the named feature as a string.booleanisPresent(java.lang.String name)Determines if the given feature is present.voidremove(java.lang.String name)Removes the named feature from this set of features.voidsetFloat(java.lang.String name, float value)Convenience method that sets the named feature as a float.voidsetInt(java.lang.String name, int value)Convenience method that sets the named feature as a int.voidsetObject(java.lang.String name, java.lang.Object value)Sets the named feature.voidsetString(java.lang.String name, java.lang.String value)Convenience method that sets the named feature as a String.
-
-
-
Method Detail
-
isPresent
public boolean isPresent(java.lang.String name)
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
public void remove(java.lang.String name)
Removes the named feature from this set of features.- Specified by:
removein interfaceFeatureSet- Parameters:
name- the name of the feature of interest
-
getString
public java.lang.String getString(java.lang.String name)
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:
java.lang.ClassCastException- if the associated value is not a String
-
getInt
public int getInt(java.lang.String name)
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:
java.lang.ClassCastException- if the associated value is not an int.
-
getFloat
public float getFloat(java.lang.String name)
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:
java.lang.ClassCastException- if the associated value is not a float
-
getObject
public java.lang.Object getObject(java.lang.String name)
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
public void setInt(java.lang.String name, int value)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
public void setFloat(java.lang.String name, float value)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
public void setString(java.lang.String name, java.lang.String value)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
public void setObject(java.lang.String name, java.lang.Object value)Sets the named feature.- Specified by:
setObjectin interfaceFeatureSet- Parameters:
name- the name of the featurevalue- the value of the feature
-
dump
public void dump(java.io.PrintWriter output, int pad, java.lang.String title)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
public void dump(java.io.PrintWriter output, int pad, java.lang.String title, boolean showName)Dumps the FeatureSet in textual form.- Parameters:
output- where to send the formatted outputpad- the paddingtitle- the titleshowName- iftrue, include the feature name
-
-