org.helidb.backend.bpluscrs
Class ConstantRecordSizeBPlusTreeBackendFactory<K,V>

java.lang.Object
  extended by org.helidb.backend.bpluscrs.ConstantRecordSizeBPlusTreeBackendFactory<K,V>
Type Parameters:
K - The type of keys in the database.
V - The type of values in the database.
All Implemented Interfaces:
DatabaseBackendFactory<K,V,KeyAndValue<K,V>>

public class ConstantRecordSizeBPlusTreeBackendFactory<K,V>
extends Object
implements DatabaseBackendFactory<K,V,KeyAndValue<K,V>>

This is a DatabaseBackendFactory for creating ConstantRecordSizeBPlusTreeBackend backends.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ConstantRecordSizeBPlusTreeBackend
In_jar:
helidb-crs_bplus_backend

Constructor Summary
ConstantRecordSizeBPlusTreeBackendFactory(NodeRepositoryBuilder<K> nrb, LogAdapterHolder lah)
          Constructor.
 
Method Summary
 DatabaseBackend<K,V,KeyAndValue<K,V>> create(DatabaseFiles f, boolean readOnly)
          Create a new backend for the supplied file.
 ConstantRecordSizeBPlusTreeBackendFactory<K,V> setKeyComparator(Comparator<? super K> cmp)
          Add a custom key comparator for establishing the key ordering in the database backend.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantRecordSizeBPlusTreeBackendFactory

public ConstantRecordSizeBPlusTreeBackendFactory(NodeRepositoryBuilder<K> nrb,
                                                 LogAdapterHolder lah)
Constructor.

Parameters:
nrb - A builder for building a NodeRepository that the B+ Tree can use.
lah - A log adapter holder.
Method Detail

setKeyComparator

public ConstantRecordSizeBPlusTreeBackendFactory<K,V> setKeyComparator(Comparator<? super K> cmp)
Add a custom key comparator for establishing the key ordering in the database backend.

Parameters:
cmp - The comparator.
Returns:
this.

create

public DatabaseBackend<K,V,KeyAndValue<K,V>> create(DatabaseFiles f,
                                                    boolean readOnly)
Description copied from interface: DatabaseBackendFactory
Create a new backend for the supplied file.

Specified by:
create in interface DatabaseBackendFactory<K,V,KeyAndValue<K,V>>
Parameters:
f - The file(s) containing the database data. The implementation of this method should be able to assume a specific DatabaseFiles implementation. Which depends on the implementation of the database backend to create.
readOnly - Should the backend object be created read only?
Returns:
A new database backend object.