JSAPI 2.0

javax.speech
Class SpeechEvent

Object
  extended by SpeechEvent
Direct Known Subclasses:
AudioEvent, EngineEvent, GrammarEvent, ResultEvent, SpeakableEvent

public abstract class SpeechEvent
extends Object

The root event class for all speech events.

Events from a speech Engine are not synchronized with any other event queues. Synchronization with other event queues must be implemented by the application. This root event class helps with integration of the Java Speech API and other event-driven components.

The Engine.setSpeechEventExecutor method provides examples of event queue integration.

See Also:
Engine, setSpeechEventExecutor

Field Summary
static int DISABLE_ALL
          A mask helpful in disabling all events in a subclass of SpeechEvent.
static int ENABLE_ALL
          A mask helpful in enabling all events in a subclass of SpeechEvent.
 
Constructor Summary
SpeechEvent(Object source, int id)
          Constructs a SpeechEvent object.
 
Method Summary
 int getId()
          Returns the event identifier.
 Object getSource()
          Returns the Object on which the event initially occurred.
abstract  String paramString()
          Returns a parameter String that contains the event identifier in text form.
abstract  String toString()
          Returns a printable String.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENABLE_ALL

public static final int ENABLE_ALL
A mask helpful in enabling all events in a subclass of SpeechEvent. See the list of known subclasses above.

See Also:
Constant Field Values

DISABLE_ALL

public static final int DISABLE_ALL
A mask helpful in disabling all events in a subclass of SpeechEvent. See the list of known subclasses above.

See Also:
Constant Field Values
Constructor Detail

SpeechEvent

public SpeechEvent(Object source,
                   int id)
Constructs a SpeechEvent object.

Parameters:
source - the object that issued the event
id - the event identifier
Throws:
IllegalArgumentException - if source is null
See Also:
getSource, getId
Method Detail

getId

public int getId()
Returns the event identifier. Id values are defined for each sub-class of SpeechEvent.

Returns:
the event identifier.

paramString

public abstract String paramString()
Returns a parameter String that contains the event identifier in text form.

The method toString may provide more detail. This method is useful for event-logging and for debugging.

Returns:
a String that contains the event identifier in text form.
See Also:
toString

toString

public abstract String toString()
Returns a printable String. Useful for event-logging and debugging.

The method paramString also provides printable information.

Overrides:
toString in class Object
Returns:
A printable string.
See Also:
paramString

getSource

public Object getSource()
Returns the Object on which the event initially occurred.

Returns:
the object on which the event initially occurred.

JSAPI 2.0

JavaTM Speech API 2.0, Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.

Free Web Hosting