Module io.hotmoka.patricia.api
Package io.hotmoka.patricia.api
Interface PatriciaTrie<Key,Value extends Marshallable>
- Type Parameters:
Key- the type of the keys of the trieValue- the type of the values of the trie
public interface PatriciaTrie<Key,Value extends Marshallable>
A Merkle-Patricia trie.
-
Method Summary
Modifier and TypeMethodDescriptionvoidgarbageCollect(long commitNumber) Garbage-collects all keys that have been updated during the given number of commit.Yields the value bound to the given key.byte[]getRoot()Yields the root of the trie, that can be used as a hash of its content.voidBinds the given key to the given value.
-
Method Details
-
get
Yields the value bound to the given key.- Parameters:
key- the key- Returns:
- the value, if any
-
put
Binds the given key to the given value. It replaces it if already present.- Parameters:
key- the keyvalue- the value
-
getRoot
byte[] getRoot()Yields the root of the trie, that can be used as a hash of its content.- Returns:
- the root
-
garbageCollect
void garbageCollect(long commitNumber) Garbage-collects all keys that have been updated during the given number of commit.- Parameters:
commitNumber- the number of the commit to garbage collect
-