|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface ICachingDictionary.IItemCache
The cache used by a caching dictionary.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.mit.jwi.data.IHasLifecycle |
|---|
IHasLifecycle.LifecycleState, IHasLifecycle.ObjectClosedException, IHasLifecycle.ObjectOpenException |
| Method Summary | ||
|---|---|---|
void |
cacheItem(IItem<?> item)
Caches the specified item, if this cache is enabled. |
|
void |
cacheSenseEntry(ISenseEntry entry)
Caches the specified entry. |
|
void |
cacheWordByKey(IWord word)
Caches the specified word, indexed by its sense key. |
|
void |
clear()
Removes all entries from the cache. |
|
int |
getMaximumCapacity()
Returns the maximum capacity of this cache. |
|
boolean |
isEnabled()
Returns true if this cache is enabled;
false otherwise. |
|
|
retrieveItem(D id)
Retrieves the item identified by the specified id. |
|
ISenseEntry |
retrieveSenseEntry(ISenseKey key)
Retrieves the sense entry identified by the specified sense key. |
|
IWord |
retrieveWord(ISenseKey key)
Retrieves the word identified by the specified sense key. |
|
void |
setEnabled(boolean isEnabled)
Enables ( true) or disables (false) caching. |
|
void |
setMaximumCapacity(int capacity)
Sets the maximum capacity of the cache |
|
int |
size()
Returns the number of items in the cache. |
|
| Methods inherited from interface edu.mit.jwi.data.IHasLifecycle |
|---|
isOpen, open |
| Methods inherited from interface edu.mit.jwi.data.IClosable |
|---|
close |
| Method Detail |
|---|
boolean isEnabled()
true if this cache is enabled;
false otherwise. If a cache is enabled, it will cache an
item passed to its cache methods.
true if this cache is enabled;
false otherwisevoid setEnabled(boolean isEnabled)
true) or disables (false) caching.
isEnabled - if true, caching is enabled; if
false, caching is disabled.void setMaximumCapacity(int capacity)
capacity - the maximum capacityint getMaximumCapacity()
int size()
void cacheItem(IItem<?> item)
item - the item to be cached; may not be null
java.lang.NullPointerException - if the specified item is nullvoid cacheWordByKey(IWord word)
word - the word to be cached; may not be null
java.lang.NullPointerException - if the specified word is nullvoid cacheSenseEntry(ISenseEntry entry)
entry - the entry to be cached; may not be null
java.lang.NullPointerException - if the specified entry is null<T extends IItem<D>,D extends IItemID<T>> T retrieveItem(D id)
T - the type of the itemD - the type of the item idid - the id for the requested item
null if not
present in the cache
java.lang.NullPointerException - if the specified id is nullIWord retrieveWord(ISenseKey key)
key - the sense key for the requested word
null if not
present in the cache
java.lang.NullPointerException - if the specified key is nullISenseEntry retrieveSenseEntry(ISenseKey key)
key - the sense key for the requested sense entry
null if not
present in the cache
java.lang.NullPointerException - if the specified key is nullvoid clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||