HashDBM class

Hash-based implementation of DBM

Implemented types

Constructors

HashDBM(RandomAccessFile file, {int buckets = 10007, bool flush = true, bool crc = false})
Open a new database. Optional parameters are: buckets which sets the number of hash buckets to use, flush which when set to true will force data to disk every time it is changed, and crc which will enable CRC checks on underlying records if set to true. The defaults are generally good enough.

Properties

file RandomAccessFile
Get the underlying file
no setter
hashCode int
The hash code for this object.
no setterinherited
hashTableSize int
Get the number of buckets in the hash table.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Erases all data and resets the internal structure, but does not reclaim storage.
override
close() → void
flush() and close the underlying file.
override
count() int
Get the number of records stored in the database as a Uint64
override
entries() Iterator<MapEntry<Uint8List, Uint8List>>
Iterate over all keys and values in the database
override
flush() → void
Flush all data to external storage.
override
get(Uint8List key) Uint8List?
Get a value from the database using key, or else return null
override
modified() DateTime
Get the last time the database was opened or modified.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(Uint8List key, Uint8List value) Uint8List?
Add a key, value pair to the underlying store, overwriting any existing values. Returns the old value if one existed.
override
putIfAbsent(Uint8List key, Uint8List value) Uint8List
Add a key, value pair to the underlying store if not key is in the underlying store. Returns the old value if key existed, otherwise value is returned.
override
remove(Uint8List key) Uint8List?
Remove a value from the database using key. If the key had an associated value, return the value or else return null
override
size() int
Get the size, in bytes, of data stored. This is intended to track approximate data size and will differ from the size of the file itself.
override
toString() String
A string representation of this object.
inherited
version() int
Get the version of the underlying implementation as a 32bit integer.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

VERSION int
Version of the database
final