Class MemoryStore
java.lang.Object
com.github.mizosoft.methanol.internal.cache.MemoryStore
- All Implemented Interfaces:
Store, Closeable, Flushable, AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface Store
Store.Editor, Store.EntryReader, Store.EntryWriter, Store.Viewer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all entries from this store.voidclose()Closes this store.voiddispose()Atomically clears and closes this store.Synchronous variant ofStore.edit(String, Executor).Opens an editor for the entry associated with the given key.voidflush()Flushes any indexing data buffered by this store.iterator()Returns an iterator ofViewersover the entries in this store.longmaxSize()Returns this store's max size in bytes.booleanRemoves the entry associated with the given key.longsize()Returns the size in bytes of all entries in this store.toString()Synchronous variant ofStore.view(String, Executor).Opens a viewer for the entry associated with the given key.
-
Constructor Details
-
MemoryStore
public MemoryStore(long maxSize)
-
-
Method Details
-
maxSize
-
size
-
view
Description copied from interface:StoreSynchronous variant ofStore.view(String, Executor). -
view
Description copied from interface:StoreOpens a viewer for the entry associated with the given key. An empty optional is returned if there's no such entry. -
edit
Description copied from interface:StoreSynchronous variant ofStore.edit(String, Executor). -
edit
Description copied from interface:StoreOpens an editor for the entry associated with the given key. An empty optional is returned either if there's no such entry, or such entry cannot be edited at the moment. -
iterator
Description copied from interface:StoreReturns an iterator ofViewersover the entries in this store. The iterator doesn't throwConcurrentModificationExceptionwhen the store is asynchronously modified, but there's no guarantee such changes are reflected. -
remove
-
clear
-
dispose
-
close
public void close()Description copied from interface:StoreCloses this store. Once the store is closed, all ongoing edits fail, either silently or by throwing an exception, to write or commit anything. -
flush
-
toString
-