org.jvoicexml.implementation
Class SrgsXmlGrammarImplementation

java.lang.Object
  extended by org.jvoicexml.implementation.SrgsXmlGrammarImplementation
All Implemented Interfaces:
GrammarImplementation<SrgsXmlDocument>

public final class SrgsXmlGrammarImplementation
extends Object
implements GrammarImplementation<SrgsXmlDocument>

Implementation of a SRGS XML grammar.

Since:
0.5.5
Version:
$Revision: 2592 $
Author:
Dirk Schnelle-Walka

Constructor Summary
SrgsXmlGrammarImplementation(SrgsXmlDocument doc)
          Constructs a new object.
 
Method Summary
 boolean accepts(RecognitionResult result)
          Checks, if this grammar covers the given recognition result.
 boolean equals(GrammarImplementation<SrgsXmlDocument> other)
          Checks if this grammar implementation is equal to the given grammar implementation.
 SrgsXmlDocument getGrammar()
          Retrieves the grammar object.
 GrammarType getMediaType()
          Returns the declared media type of the external grammar.
 ModeType getModeType()
          Returns the mode type of the grammar.
 int hashCode()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrgsXmlGrammarImplementation

public SrgsXmlGrammarImplementation(SrgsXmlDocument doc)
Constructs a new object.

Parameters:
doc - the grammar.
Method Detail

getGrammar

public SrgsXmlDocument getGrammar()
Retrieves the grammar object.

Specified by:
getGrammar in interface GrammarImplementation<SrgsXmlDocument>
Returns:
the grammar.

getMediaType

public GrammarType getMediaType()
Returns the declared media type of the external grammar.

Specified by:
getMediaType in interface GrammarImplementation<SrgsXmlDocument>
Returns:
The media type of the grammar file.

getModeType

public ModeType getModeType()
Returns the mode type of the grammar.

Specified by:
getModeType in interface GrammarImplementation<SrgsXmlDocument>
Returns:
mode type of the grammar.

accepts

public boolean accepts(RecognitionResult result)
Checks, if this grammar covers the given recognition result.

It is not legal to check if the result is accepted using RecognitionResult.isAccepted(). Implementations should assume that it is a valid input result.

Implementations can use the GrammarChecker.

Specified by:
accepts in interface GrammarImplementation<SrgsXmlDocument>
Parameters:
result - the result to check.
Returns:
true if the utterance is valid for this grammar

equals

public boolean equals(GrammarImplementation<SrgsXmlDocument> other)
Checks if this grammar implementation is equal to the given grammar implementation.

Specified by:
equals in interface GrammarImplementation<SrgsXmlDocument>
Parameters:
other - the grammar implementation to compare with.
Returns:
true if the grammar implementations are equal.

hashCode

public int hashCode()

Overrides:
hashCode in class Object
Since:
0.7.2


Copyright © 2005-2010JVoiceXML group.