Interface PatriciaTrie<Key,Value extends Marshallable>

Type Parameters:
Key - the type of the keys of the trie
Value - the type of the values of the trie

public interface PatriciaTrie<Key,Value extends Marshallable>
A Merkle-Patricia trie.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    garbageCollect(long commitNumber)
    Garbage-collects all keys that have been updated during the given number of commit.
    get(Key key)
    Yields the value bound to the given key.
    byte[]
    Yields the root of the trie, that can be used as a hash of its content.
    void
    put(Key key, Value value)
    Binds the given key to the given value.
  • Method Details

    • get

      Optional<Value> get(Key key)
      Yields the value bound to the given key.
      Parameters:
      key - the key
      Returns:
      the value, if any
    • put

      void put(Key key, Value value)
      Binds the given key to the given value. It replaces it if already present.
      Parameters:
      key - the key
      value - 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