2 * Portions Copyright 2001 Sun Microsystems, Inc.
3 * Portions Copyright 1999-2001 Language Technologies Institute,
4 * Carnegie Mellon University.
5 * All Rights Reserved. Use is subject to license terms.
7 * See the file "license.terms" for information on usage and
8 * redistribution of this file, and for a DISCLAIMER OF ALL
11 package com.sun.speech.freetts;
13 import java.io.PrintWriter;
16 * Represents the abstract interface to an entity that has
17 * a set of features. Provides interfaces to set and get the name/value
18 * pairs as well as providing a set of convenience methods for
19 * setting and retrieving values of a particular type.
22 public interface FeatureSet extends Dumpable {
26 * Determines if the given feature is present.
28 * @param name the name of the feature of interest
30 * @return true if the named feature is present
32 public boolean isPresent(String name);
36 * Removes the named feature from this set of features.
38 * @param name the name of the feature of interest
40 public void remove(String name);
43 * Convenience method that returns the named feature as a string.
45 * @param name the name of the feature
47 * @return the value associated with the name or null if the value
50 * @throws ClassCastException if theassociated value is not a
53 public String getString(String name);
56 * Convenience method that returns the named feature as an int.
58 * @param name the name of the feature
60 * @return the value associated with the name or null if the value
63 * @throws ClassCastException if the associated value is not an
66 public int getInt(String name);
69 * Convenience method that returns the named feature as a float.
71 * @param name the name of the feature
73 * @return the value associated with the name or null if the value
76 * @throws ClassCastException if the associated value is not a
79 public float getFloat(String name);
82 * Returns the named feature as an object.
84 * @param name the name of the feature
86 * @return the value associated with the name or null if the value
89 public Object getObject(String name);
92 * Convenience method that sets the named feature as an int.
94 * @param name the name of the feature
95 * @param value the value of the feature
97 public void setInt(String name, int value);
100 * Convenience method that sets the named feature as a float
102 * @param name the name of the feature
103 * @param value the value of the feature
105 public void setFloat(String name, float value);
108 * Convenience method that sets the named feature as a String.
110 * @param name the name of the feature
111 * @param value the value of the feature
113 public void setString(String name, String value);
116 * Sets the named feature .
118 * @param name the name of the feature
119 * @param value the value of the feature
121 public void setObject(String name, Object value);
124 * Dumps the FeatureSet in textual form.
126 * @param output where to send the formatted output
127 * @param pad the padding
128 * @param title the title
130 public void dump(PrintWriter output, int pad, String title);