JSAPI 2.0

javax.speech.recognition
Class RuleLocale

Object
  extended by RuleComponent
      extended by RuleLocale

public class RuleLocale
extends RuleComponent

Defines the SpeechLocale for the enclosed RuleComponent.

A RuleGrammar is defined with a SpeechLocale, but this may be changed for RuleComponents within the RuleGrammar.

See Also:
RuleGrammar, SpeechLocale

Constructor Summary
RuleLocale(RuleComponent ruleComponent, SpeechLocale locale)
          Constructs a RuleLocale specifying the SpeechLocale for the RuleComponent.
 
Method Summary
 RuleComponent getRuleComponent()
          Returns the RuleComponent to which the SpeechLocale applies.
 SpeechLocale getSpeechLocale()
          Returns the SpeechLocale for this RuleLocale.
 String toString()
          Returns a String representing this RuleComponent as grammar text.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuleLocale

public RuleLocale(RuleComponent ruleComponent,
                  SpeechLocale locale)
Constructs a RuleLocale specifying the SpeechLocale for the RuleComponent. This affects interpretation of vocabulary within the RuleComponent.

When used within a containing RuleGrammar, a GRAMMAR_CHANGES_REJECTED event will be fired if the locale is not supported.

Parameters:
ruleComponent - the RuleComponent to which the SpeechLocale applies
locale - the SpeechLocale to use
See Also:
getRuleComponent, getSpeechLocale, GRAMMAR_CHANGES_REJECTED, RuleGrammar
Method Detail

getSpeechLocale

public SpeechLocale getSpeechLocale()
Returns the SpeechLocale for this RuleLocale.

Returns:
the SpeechLocale for this RuleLocale
See Also:
getRuleComponent

getRuleComponent

public RuleComponent getRuleComponent()
Returns the RuleComponent to which the SpeechLocale applies.

Returns:
the RuleComponent to which the SpeechLocale applies.
See Also:
getSpeechLocale

toString

public String toString()
Returns a String representing this RuleComponent as grammar text. The String represents a portion of a grammar that could appear on the right hand side of a Rule definition.

Overrides:
toString in class RuleComponent
Returns:
printable String representing grammar text.
See Also:
RuleComponent, Rule

JSAPI 2.0

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

Free Web Hosting