Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class javax.speech.recognition.RuleSequence

java.lang.Object
  |
  +--javax.speech.recognition.Rule
        |
        +--javax.speech.recognition.RuleSequence

public class RuleSequence
extends Rule
RuleSequence is a Rule composed of a sequence of sub-rules that must each be spoken in order. If there are zero rules in the sequence, the sequence is equivalent to <NULL>.

See Also:
Rule, RuleAlternatives, RuleCount, RuleGrammar, RuleName, RuleParse, RuleTag, RuleToken, NULL, Serialized Form

Field Summary
Rule[] rules
          Set of rules to be spoken in sequence.
 
Constructor Summary
RuleSequence(Rule[] rules)
          Construct a RuleSequence object with an array of sub-rules.
RuleSequence(Rule rule)
          Construct a RuleSequence object containing a single Rule.
RuleSequence()
          Empty constructor creates a sequence with zero rules.
RuleSequence(String[] tokens)
          Constructor for RuleSequence that is a sequence of strings that are converted to RuleTokens.
 
Method Summary
void append(Rule rule)
          Append a single rule to the end of the sequence.
Rule copy()
          Return a deep copy of this rule.
Rule[] getRules()
          Return the array of rules in the sequence.
void setRules(Rule[] rules)
          Set the array of rules in the sequence.
String toString()
          Return a String representing this RuleSequence object as partial Java Speech Grammar Format.
 
Methods inherited from class javax.speech.recognition.Rule
copy, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

rules

protected Rule[] rules
Set of rules to be spoken in sequence.

See Also:
getRules
Constructor Detail

RuleSequence

public RuleSequence(Rule[] rules)
Construct a RuleSequence object with an array of sub-rules.

RuleSequence

public RuleSequence(Rule rule)
Construct a RuleSequence object containing a single Rule.

RuleSequence

public RuleSequence()
Empty constructor creates a sequence with zero rules. A sequence with zero rules is equivalent to <NULL>.

See Also:
NULL

RuleSequence

public RuleSequence(String[] tokens)
Constructor for RuleSequence that is a sequence of strings that are converted to RuleTokens.

A string containing multiple words (e.g. "san francisco") is treated as a single token. If appropriate, an application should parse such strings to produce separate tokens.

The token list may be zero-length or null. This will produce a zero-length sequence which is equivalent to <NULL>.

See Also:
RuleToken
Method Detail

getRules

public Rule[] getRules()
Return the array of rules in the sequence.

setRules

public void setRules(Rule[] rules)
Set the array of rules in the sequence. The array may be zero-length or null. This will produce a zero-length sequence which is equivalent to <NULL>.


append

public void append(Rule rule)
Append a single rule to the end of the sequence.

copy

public Rule copy()
Return a deep copy of this rule. See the Rule.copy documentation for an explanation of deep copy.
Overrides:
copy in class Rule

toString

public String toString()
Return a String representing this RuleSequence object as partial Java Speech Grammar Format.
Overrides:
toString in class Rule

Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com