public class ActiveGrammarSet extends java.lang.Object implements ScopedSetObserver<GrammarDocument>
ScopeObservers
can be added to monitor scope related changes in this grammar set.Scope| Constructor and Description |
|---|
ActiveGrammarSet(ScopeObserver scopeObserver)
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
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(java.util.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.
|
java.util.Collection<GrammarDocument> |
getGrammars()
Retrieves the grammars that are currently contained in the set.
|
java.util.Collection<org.jvoicexml.xml.srgs.GrammarType> |
getGrammarTypes()
Retrieves the grammar types in the active grammar set.
|
java.util.Collection<org.jvoicexml.xml.srgs.ModeType> |
getModeTypes()
Retrieves the mode types in the active grammar set.
|
void |
removeActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
Removes the given scope observer from the list of known observers.
|
void |
removeAll(java.util.Collection<GrammarDocument> grams)
Removes the given grammars to the active grammar set.
|
void |
scopedSetChange(ScopedSet<GrammarDocument> set,
java.util.Collection<GrammarDocument> removed)
The given set changed due to a scope change.
|
int |
size()
Retrieves the number of active grammars.
|
public ActiveGrammarSet(ScopeObserver scopeObserver)
scopeObserver - The current scope observer.public void addActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
obs - the observer to addpublic void removeActiveGrammarSetObserver(ActiveGrammarSetObserver obs)
obs - the observer to removepublic int size()
public void add(GrammarDocument grammar)
grammar - the grammar to addpublic void addAll(java.util.Collection<GrammarDocument> grams)
grams - the grammars to addpublic void removeAll(java.util.Collection<GrammarDocument> grams)
grams - the grammars to removepublic boolean contains(GrammarDocument document)
document - the grammar document to look for.true if the active grammar set contains the given
grammar documentpublic java.util.Collection<GrammarDocument> getGrammars()
public java.util.Collection<org.jvoicexml.xml.srgs.GrammarType> getGrammarTypes()
public java.util.Collection<org.jvoicexml.xml.srgs.ModeType> getModeTypes()
public void scopedSetChange(ScopedSet<GrammarDocument> set, java.util.Collection<GrammarDocument> removed)
scopedSetChange in interface ScopedSetObserver<GrammarDocument>set - the changed setremoved - the removed items