Class PatriciaTries

java.lang.Object
io.hotmoka.patricia.PatriciaTries

public final class PatriciaTries extends Object
Provider of Merkle-Patricia tries.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    A function that supplies an unmarshalling context.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <Key, Value extends io.hotmoka.marshalling.api.Marshallable>
    PatriciaTrie<Key,Value>
    of(KeyValueStore store, io.hotmoka.crypto.api.HashingAlgorithm<? super Key> hashingForKeys, io.hotmoka.crypto.api.HashingAlgorithm<byte[]> hashingForNodes, io.hotmoka.marshalling.api.Unmarshaller<? extends Value> valueUnmarshaller, PatriciaTries.UnmarshallingContextSupplier unmarshallingContextSupplier, long numberOfCommits)
    Yields a Merkle-Patricia trie supported by the underlying store, using the given hashing algorithm to hash nodes, keys and the values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      public static <Key, Value extends io.hotmoka.marshalling.api.Marshallable> PatriciaTrie<Key,Value> of(KeyValueStore store, io.hotmoka.crypto.api.HashingAlgorithm<? super Key> hashingForKeys, io.hotmoka.crypto.api.HashingAlgorithm<byte[]> hashingForNodes, io.hotmoka.marshalling.api.Unmarshaller<? extends Value> valueUnmarshaller, PatriciaTries.UnmarshallingContextSupplier unmarshallingContextSupplier, long numberOfCommits)
      Yields a Merkle-Patricia trie supported by the underlying store, using the given hashing algorithm to hash nodes, keys and the values.
      Type Parameters:
      Key - the type of the keys of the trie
      Value - the type of the values of the trie
      Parameters:
      store - the store used to store a mapping from nodes' hashes to their content
      hashingForKeys - the hashing algorithm for the keys
      hashingForNodes - the hashing algorithm for the nodes of the trie
      valueUnmarshaller - a function able to unmarshall a value from its byte representation
      unmarshallingContextSupplier - the supplier of the unmarshalling context
      numberOfCommits - the current number of commits already executed on the store; this trie will record which data must be garbage collected (eventually) as result of the store updates performed during that commit; this could be -1L if the trie is only used or reading
      Returns:
      the trie