|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectRuleComponent
RuleSequence
public class RuleSequence
Specifies a RuleComponent
composed of a sequence of
sub-RuleComponent
s that must each be spoken in sequence order.
If there are zero RuleComponent
s in the sequence,
the sequence behaves the same as NULL
.
NULL
Constructor Summary | |
---|---|
RuleSequence(RuleComponent[] ruleComponents)
Constructs a RuleSequence with a sequence
of RuleComponent s. |
|
RuleSequence(String[] tokens)
Constructs a RuleSequence from a sequence
of String s converted to a sequence of RuleToken s. |
Method Summary | |
---|---|
RuleComponent[] |
getRuleComponents()
Returns the array of RuleComponent s that defines this sequence. |
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 |
---|
public RuleSequence(String[] tokens)
RuleSequence
from a sequence
of String
s converted to a sequence of RuleToken
s.
A String
containing multiple words (e.g. "San Francisco")
is treated as a single token in a RuleToken
.
If appropriate, an application should parse a String sequence element
into separate RuleToken
s to create a corresponding
RuleSequence
as an element within the resulting RuleSequence.
A zero-length tokens
list
results in a zero-length RuleSequence
that is equivalent to NULL
.
tokens
- a sequence of String
s converted
to RuleToken
s
IllegalArgumentException
- if null
tokens
NULL
,
RuleToken
,
getRuleComponents
public RuleSequence(RuleComponent[] ruleComponents)
RuleSequence
with a sequence
of RuleComponent
s.
A zero-length ruleComponents
list
results in a zero-length RuleSequence
that is equivalent to NULL
.
ruleComponents
- a sequence of RuleComponent
s
IllegalArgumentException
- if null
ruleComponents
NULL
,
getRuleComponents
Method Detail |
---|
public RuleComponent[] getRuleComponents()
RuleComponent
s that defines this sequence.
If a zero-length array is returned, this is treated the
same as NULL
.
RuleComponent
s in this sequenceNULL
public String toString()
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.
Note that an empty sequence is represented as NULL
.
toString
in class RuleComponent
String
representing grammar text.NULL
,
RuleComponent
,
Rule
|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API 2.0,
Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.