org.mapdb
Class DB.HTreeMapMaker

java.lang.Object
  extended by org.mapdb.DB.HTreeMapMaker
Enclosing class:
DB

public class DB.HTreeMapMaker
extends Object


Field Summary
protected  boolean counter
           
protected  long expire
           
protected  long expireAccess
           
protected  long expireMaxSize
           
protected  long expireStoreSize
           
protected  Hasher<?> hasher
           
protected  Serializer<?> keySerializer
           
protected  String name
           
protected  Fun.Function1<?,?> valueCreator
           
protected  Serializer<?> valueSerializer
           
 
Constructor Summary
DB.HTreeMapMaker(String name)
           
 
Method Summary
 DB.HTreeMapMaker counterEnable()
          by default collection does not have counter, without counter updates are faster, but entire collection needs to be traversed to count items.
 DB.HTreeMapMaker expireAfterAccess(long interval)
          Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access.
 DB.HTreeMapMaker expireAfterAccess(long interval, TimeUnit timeUnit)
          Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access.
 DB.HTreeMapMaker expireAfterWrite(long interval)
          Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.
 DB.HTreeMapMaker expireAfterWrite(long interval, TimeUnit timeUnit)
          Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.
 DB.HTreeMapMaker expireMaxSize(long maxSize)
          maximal number of entries in this map.
 DB.HTreeMapMaker expireStoreSize(double maxStoreSize)
           
 DB.HTreeMapMaker hasher(Hasher<?> hasher)
           
 DB.HTreeMapMaker keySerializer(Serializer<?> keySerializer)
          keySerializer used to convert keys into/from binary form.
<K,V> HTreeMap<K,V>
make()
           
<K,V> HTreeMap<K,V>
makeOrGet()
           
 DB.HTreeMapMaker valueCreator(Fun.Function1<?,?> valueCreator)
          If value is not found, HTreeMap can fetch and insert default value.
 DB.HTreeMapMaker valueSerializer(Serializer<?> valueSerializer)
          valueSerializer used to convert values into/from binary form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected final String name

counter

protected boolean counter

keySerializer

protected Serializer<?> keySerializer

valueSerializer

protected Serializer<?> valueSerializer

expireMaxSize

protected long expireMaxSize

expire

protected long expire

expireAccess

protected long expireAccess

expireStoreSize

protected long expireStoreSize

hasher

protected Hasher<?> hasher

valueCreator

protected Fun.Function1<?,?> valueCreator
Constructor Detail

DB.HTreeMapMaker

public DB.HTreeMapMaker(String name)
Method Detail

counterEnable

public DB.HTreeMapMaker counterEnable()
by default collection does not have counter, without counter updates are faster, but entire collection needs to be traversed to count items.


keySerializer

public DB.HTreeMapMaker keySerializer(Serializer<?> keySerializer)
keySerializer used to convert keys into/from binary form.


valueSerializer

public DB.HTreeMapMaker valueSerializer(Serializer<?> valueSerializer)
valueSerializer used to convert values into/from binary form.


expireMaxSize

public DB.HTreeMapMaker expireMaxSize(long maxSize)
maximal number of entries in this map. Less used entries will be expired and removed to make collection smaller


expireAfterWrite

public DB.HTreeMapMaker expireAfterWrite(long interval,
                                         TimeUnit timeUnit)
Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.


expireAfterWrite

public DB.HTreeMapMaker expireAfterWrite(long interval)
Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.


expireAfterAccess

public DB.HTreeMapMaker expireAfterAccess(long interval,
                                          TimeUnit timeUnit)
Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access. Access time is reset by all map read and write operations


expireAfterAccess

public DB.HTreeMapMaker expireAfterAccess(long interval)
Specifies that each entry should be automatically removed from the map once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access. Access time is reset by all map read and write operations


expireStoreSize

public DB.HTreeMapMaker expireStoreSize(double maxStoreSize)

valueCreator

public DB.HTreeMapMaker valueCreator(Fun.Function1<?,?> valueCreator)
If value is not found, HTreeMap can fetch and insert default value. `valueCreator` is used to return new value. This way `HTreeMap.get()` never returns null


hasher

public DB.HTreeMapMaker hasher(Hasher<?> hasher)

make

public <K,V> HTreeMap<K,V> make()

makeOrGet

public <K,V> HTreeMap<K,V> makeOrGet()


Copyright © 2014. All Rights Reserved.