Overview | Package | Class | Tree | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.speech.recognition.Rule | +--javax.speech.recognition.RuleCount
Rule
object to
indicate the number of times it may occur. The contained
rule may occur optionally (zero or one times), one or more times,
or zero or more times. The three count are equivalent to
the "[]", "+" and "*" operators of the Java Speech Grammar Format.
Any Rule
not contained by a RuleCount
object
occurs once only.
Field Summary | |
int | count
Identifier for the rule count. |
static int | ONCE_OR_MORE
ONCE_OR_MORE indicates that the Rule may be
spoken one or more times. |
static int | OPTIONAL
OPTIONAL indicates that the Rule is optional:
zero or one occurrences. |
Rule | rule
The rule to which the count applies. |
static int | ZERO_OR_MORE
ZERO_OR_MORE indicates that the Rule may be
spoken zero or more times. |
Constructor Summary | |
RuleCount(Rule rule,
int count)
RuleCount constructor with contained rule and count. |
|
RuleCount()
Empty constructor sets rule to null and count to OPTIONAL . |
Method Summary | |
Rule | copy()
Return a deep copy of this rule. |
int | getCount()
Returns the count: OPTIONAL , ZERO_OR_MORE ,
ONCE_OR_MORE .
|
Rule | getRule()
Returns the contained Rule object. |
void | setCount(int count)
Set the count. |
void | setRule(Rule rule)
Set the contained Rule object. |
String | toString()
Return a string representing the RuleCount object in
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 |
protected Rule rule
protected int count
public static int OPTIONAL
OPTIONAL
indicates that the Rule
is optional:
zero or one occurrences. An optional Rule
is surrounded
by "[]" in Java Speech Grammar Format.public static int ONCE_OR_MORE
ONCE_OR_MORE
indicates that the Rule
may be
spoken one or more times. This is indicated by the "+" operator in
Java Speech Grammar Format.public static int ZERO_OR_MORE
ZERO_OR_MORE
indicates that the Rule
may be
spoken zero or more times. This is indicated by the "*" operator in
Java Speech Grammar Format.Constructor Detail |
public RuleCount(Rule rule, int count)
RuleCount
constructor with contained rule and count.public RuleCount()
null
and count to OPTIONAL
.Method Detail |
public Rule getRule()
Rule
object.public void setRule(Rule rule)
Rule
object.public int getCount()
OPTIONAL
, ZERO_OR_MORE
,
ONCE_OR_MORE
.
public void setCount(int count)
OPTIONAL
, ZERO_OR_MORE
, ONCE_OR_MORE
)
the call is ignored.
public Rule copy()
Rule.copy
documentation for an explanation of deep copy.public String toString()
RuleCount
object in
partial Java Speech Grammar Format. The String represents the portion
of Java Speech Grammar Format that could appear on the right hand side
of a rule definition. Parenthesis will be placed
around the contained Rule
object if required.
The output appears as one of:
[ruleString] // OPTIONAL ruleString * // ZERO_OR_MORE ruleString + // ONCE_OR_MORE
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