Package be.bagofwords.db.memory
Class InMemoryDataInterface<T>
- java.lang.Object
-
- be.bagofwords.db.impl.BaseDataInterface<T>
-
- be.bagofwords.db.CoreDataInterface<T>
-
- be.bagofwords.db.memory.InMemoryDataInterface<T>
-
- All Implemented Interfaces:
DataInterface<T>,be.bagofwords.iterator.DataIterable<be.bagofwords.util.KeyValue<T>>,Iterable<be.bagofwords.util.KeyValue<T>>
public class InMemoryDataInterface<T> extends CoreDataInterface<T>
-
-
Field Summary
-
Fields inherited from class be.bagofwords.db.CoreDataInterface
updateListenerCollection
-
Fields inherited from class be.bagofwords.db.impl.BaseDataInterface
combinator, isTemporaryDataInterface, name, objectClass, objectSerializer
-
-
Constructor Summary
Constructors Constructor Description InMemoryDataInterface(String name, Class<T> objectClass, Combinator<T> combinator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longapprSize()protected voiddoClose()voiddropAllData()longexactSize()You don't want to use this if you could use apprSize()voidflushImpl()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator()be.bagofwords.iterator.CloseableIterator<Long>keyIterator()booleanmightContain(long key)voidoptimizeForReading()Tread(long key)voidwrite(long key, T value)voidwrite(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)-
Methods inherited from class be.bagofwords.db.CoreDataInterface
flush, getCoreDataInterface, registerUpdateListener
-
Methods inherited from class be.bagofwords.db.impl.BaseDataInterface
apprDataChecksum, close, finalize, getCombinator, getName, getObjectClass, getObjectSerializer, ifNotClosed, isTemporaryDataInterface, wasClosed
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface be.bagofwords.db.DataInterface
cachedValueIterator, increaseCount, increaseCount, increaseCount, increaseCount, iterator, iterator, iterator, iterator, mightContain, read, read, readCount, readCount, readCount, remove, remove, stream, stream, stream, stream, streamKeys, streamValues, streamValues, streamValues, streamValues, streamValues, valueIterator, valueIterator, valueIterator, valueIterator, valueIterator, write, write, write
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
InMemoryDataInterface
public InMemoryDataInterface(String name, Class<T> objectClass, Combinator<T> combinator)
-
-
Method Detail
-
read
public T read(long key)
-
write
public void write(long key, T value)
-
write
public void write(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator()
-
dropAllData
public void dropAllData()
-
flushImpl
public void flushImpl()
- Specified by:
flushImplin classCoreDataInterface<T>
-
doClose
protected void doClose()
- Specified by:
doClosein classBaseDataInterface<T>
-
apprSize
public long apprSize()
-
keyIterator
public be.bagofwords.iterator.CloseableIterator<Long> keyIterator()
-
optimizeForReading
public void optimizeForReading()
-
exactSize
public long exactSize()
Description copied from class:BaseDataInterfaceYou don't want to use this if you could use apprSize()- Specified by:
exactSizein interfaceDataInterface<T>- Overrides:
exactSizein classBaseDataInterface<T>
-
mightContain
public boolean mightContain(long key)
-
-