Interface FontAttributesCache<K extends Serializable,E extends Throwable>
-
- Type Parameters:
K- type of font identifierE- type of exception thrown in case of failure to retrieve the cached data
- All Superinterfaces:
Provider<Collection<FontSource>,E>
- All Known Implementing Classes:
FileFontAttributesCache
public interface FontAttributesCache<K extends Serializable,E extends Throwable> extends Provider<Collection<FontSource>,E>
An interface providing the blueprint forFontAttributeSetcache implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(K identifier, FontAttributeSet attributes)Adds a pair of an identifier for a font and theFontAttributeSetfor that font to the cache.Map<K,FontAttributeSet>getAllEntries()Get all entries which are currently stored in the cacheFontAttributeSetgetFontAttributesEntry(K identifier)Get theFontAttributeSetcached for the font identified by the given identifiervoidinvalidateCache()Removes all entries from the cache.voidremove(K identifier)Removes theFontAttributeSetfor the font identified by the given identifier.voidwriteCache()Persists the cache.
-
-
-
Method Detail
-
add
void add(K identifier, FontAttributeSet attributes)
Adds a pair of an identifier for a font and theFontAttributeSetfor that font to the cache.- Parameters:
identifier- an object identifying the font.attributes- theFontAttributeSetfor the font to be added
-
remove
void remove(K identifier)
Removes theFontAttributeSetfor the font identified by the given identifier. If there was no information stored for the given identifier nothing happens.- Parameters:
identifier- the identifier of the entry to remove the information for.
-
invalidateCache
void invalidateCache()
Removes all entries from the cache.
-
getAllEntries
Map<K,FontAttributeSet> getAllEntries()
Get all entries which are currently stored in the cache- Returns:
- the current state of the Map containing all entries.
-
getFontAttributesEntry
FontAttributeSet getFontAttributesEntry(K identifier)
Get theFontAttributeSetcached for the font identified by the given identifier- Parameters:
identifier- The identifier of the font- Returns:
- The
FontAttributeSetfor the font identified by the given identifier as stored in the cache.
nullmay be returned if either there is no entry for the identifier or if theFontAttributeSetfor the font arenull.
-
-