public final class GrammarCache
extends java.lang.Object
| Constructor and Description |
|---|
GrammarCache()
Constructs a new object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(LoadedGrammar grammar)
Adds the given grammar to the active grammar set.
|
boolean |
contains(GrammarDocument document)
Checks if the active grammar set contains the given grammar document.
|
boolean |
contains(GrammarImplementation<?> implementation)
Checks if the active grammar set contains the given grammar
implementation.
|
LoadedGrammar |
get(GrammarDocument document)
Retrieves the processed grammar for the given document.
|
GrammarImplementation<?> |
getImplementation(GrammarDocument document)
Retrieves the cached implementation of the give grammar document.
|
java.util.Collection<GrammarImplementation<?>> |
getImplementations()
Retrieves the set of active grammar implementations.
|
int |
size()
Retrieves the number of active grammars.
|
public int size()
public void add(LoadedGrammar grammar)
grammar - the grammar to addpublic java.util.Collection<GrammarImplementation<?>> getImplementations()
public LoadedGrammar get(GrammarDocument document)
document - the grammar document to look fornull if there is no processed
grammar.public GrammarImplementation<?> getImplementation(GrammarDocument document)
document - the documentnullpublic boolean contains(GrammarDocument document)
document - the grammar document to look for.true if the active grammar set contains the given
grammar documentpublic boolean contains(GrammarImplementation<?> implementation)
implementation - the grammar implementation to look for.true if the active grammar set contains the given
grammar implementation