Package be.bagofwords.db
Class LayeredDataInterface<T>
- java.lang.Object
-
- be.bagofwords.db.impl.BaseDataInterface<T>
-
- be.bagofwords.db.LayeredDataInterface<T>
-
- All Implemented Interfaces:
DataInterface<T>,be.bagofwords.iterator.DataIterable<be.bagofwords.util.KeyValue<T>>,Iterable<be.bagofwords.util.KeyValue<T>>
- Direct Known Subclasses:
BloomFilterDataInterface,CachedDataInterface
public abstract class LayeredDataInterface<T> extends BaseDataInterface<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected DataInterface<T>baseInterface-
Fields inherited from class be.bagofwords.db.impl.BaseDataInterface
combinator, isTemporaryDataInterface, name, objectClass, objectSerializer
-
-
Constructor Summary
Constructors Constructor Description LayeredDataInterface(DataInterface<T> baseInterface)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longapprSize()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>cachedValueIterator()protected voiddoClose()protected abstract voiddoCloseImpl()voiddropAllData()voidflush()DataInterface<T>getCoreDataInterface()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator()be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator(KeyFilter keyFilter)be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>>iterator(java.util.function.Predicate<T> valueFilter)be.bagofwords.iterator.CloseableIterator<Long>keyIterator()booleanmightContain(long key)voidoptimizeForReading()Tread(long key)voidregisterUpdateListener(UpdateListener<T> updateListener)java.util.stream.Stream<T>streamValues(KeyFilter keyFilter)java.util.stream.Stream<T>streamValues(java.util.function.Predicate<T> valueFilter)be.bagofwords.iterator.CloseableIterator<T>valueIterator()be.bagofwords.iterator.CloseableIterator<T>valueIterator(KeyFilter keyFilter)be.bagofwords.iterator.CloseableIterator<T>valueIterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)voidwrite(long key, T value)voidwrite(be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> entries)-
Methods inherited from class be.bagofwords.db.impl.BaseDataInterface
apprDataChecksum, close, exactSize, 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
increaseCount, increaseCount, increaseCount, increaseCount, iterator, mightContain, read, read, readCount, readCount, readCount, remove, remove, stream, stream, stream, stream, streamKeys, streamValues, streamValues, streamValues, valueIterator, valueIterator, write, write, write
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
baseInterface
protected DataInterface<T> baseInterface
-
-
Constructor Detail
-
LayeredDataInterface
public LayeredDataInterface(DataInterface<T> baseInterface)
-
-
Method Detail
-
read
public T read(long key)
-
write
public void write(long key, T value)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator()
-
dropAllData
public void dropAllData()
-
flush
public void flush()
-
optimizeForReading
public void optimizeForReading()
-
getCoreDataInterface
public DataInterface<T> getCoreDataInterface()
- Specified by:
getCoreDataInterfacein interfaceDataInterface<T>- Specified by:
getCoreDataInterfacein classBaseDataInterface<T>
-
registerUpdateListener
public void registerUpdateListener(UpdateListener<T> updateListener)
-
apprSize
public long apprSize()
-
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(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(java.util.function.Predicate<T> valueFilter)
-
iterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> iterator(KeyFilter keyFilter)
-
keyIterator
public be.bagofwords.iterator.CloseableIterator<Long> keyIterator()
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator()
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator(KeyFilter keyFilter)
-
valueIterator
public be.bagofwords.iterator.CloseableIterator<T> valueIterator(be.bagofwords.iterator.CloseableIterator<Long> keyIterator)
-
streamValues
public java.util.stream.Stream<T> streamValues(java.util.function.Predicate<T> valueFilter)
-
mightContain
public boolean mightContain(long key)
-
doClose
protected final void doClose()
- Specified by:
doClosein classBaseDataInterface<T>
-
cachedValueIterator
public be.bagofwords.iterator.CloseableIterator<be.bagofwords.util.KeyValue<T>> cachedValueIterator()
-
doCloseImpl
protected abstract void doCloseImpl()
-
-