org.jvoicexml.interpreter
Class ActiveGrammarSet

java.lang.Object
  extended by org.jvoicexml.interpreter.ActiveGrammarSet
All Implemented Interfaces:
ScopedSetObserver<GrammarDocument>

public final class ActiveGrammarSet
extends Object
implements ScopedSetObserver<GrammarDocument>

The set of grammars active during a VoiceXML interpreter context's input collection operation.

Since:
0.7.2
Version:
$Revision: 2670 $
Author:
Dirk Schnelle-Walka

Constructor Summary
ActiveGrammarSet(ScopeObserver scopeObserver)
          Constructs a new object.
 
Method Summary
 void add(GrammarDocument grammar)
          Adds the given grammar to the active grammar set.
 void addActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
          Adds the given observer to the list of known observers.
 void addAll(Collection<GrammarDocument> grams)
          Adds the given grammars to the active grammar set.
 boolean contains(GrammarDocument document)
          Checks if the active grammar set contains the given grammar document.
 Collection<GrammarDocument> getGrammars()
          Retrieves the grammars that are currently contained in the set.
 void removeActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
          Removes the given scope observer from the list of known observers.
 void scopedSetChange(ScopedSet<GrammarDocument> set, Collection<GrammarDocument> removed)
          The given set changed due to a scope change.
 int size()
          Retrieves the number of active grammars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActiveGrammarSet

public ActiveGrammarSet(ScopeObserver scopeObserver)
Constructs a new object.

Parameters:
scopeObserver - The current scope observer.
Method Detail

addActiveGrammarSetObserver

public void addActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
Adds the given observer to the list of known observers.

Parameters:
obs - the observer to add
Since:
0.7.3

removeActiveGrammarSetObserver

public void removeActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
Removes the given scope observer from the list of known observers.

Parameters:
obs - the observer to remove
Since:
0.7.3

size

public int size()
Retrieves the number of active grammars.

Returns:
number of active grammars

add

public void add(GrammarDocument grammar)
Adds the given grammar to the active grammar set.

Parameters:
grammar - the grammar to add

addAll

public void addAll(Collection<GrammarDocument> grams)
Adds the given grammars to the active grammar set.

Parameters:
grams - the grammar to add

contains

public boolean contains(GrammarDocument document)
Checks if the active grammar set contains the given grammar document.

Parameters:
document - the grammar document to look for.
Returns:
true if the active grammar set contains the given grammar document

getGrammars

public Collection<GrammarDocument> getGrammars()
Retrieves the grammars that are currently contained in the set.

Returns:
the grammars in the set
Since:
0.7.5

scopedSetChange

public void scopedSetChange(ScopedSet<GrammarDocument> set,
                            Collection<GrammarDocument> removed)
The given set changed due to a scope change.

Specified by:
scopedSetChange in interface ScopedSetObserver<GrammarDocument>
Parameters:
set - the changed set
removed - the removed items


Copyright © 2005-2010JVoiceXML group.