Class UpdateFunction.Simple<V>

    • Field Summary

    • Constructor Summary

      Constructors 
      Constructor Description
      Simple​(java.util.function.BiFunction<V,​V,​V> wrapped)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V insert​(V v)
      Computes the value that should be inserted in the BTree.
      V merge​(V replacing, V update)
      Computes the result of merging the existing value with the one from the update.
      static <V> UpdateFunction.Simple<V> of​(java.util.function.BiFunction<V,​V,​V> f)  
      void onAllocatedOnHeap​(long heapSize)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Simple

        public Simple​(java.util.function.BiFunction<V,​V,​V> wrapped)
    • Method Detail

      • insert

        public V insert​(V v)
        Description copied from interface: UpdateFunction
        Computes the value that should be inserted in the BTree.
        Specified by:
        insert in interface UpdateFunction<V,​V>
        Parameters:
        v - the update value
        Returns:
        the value that should be inserted in the BTree
      • merge

        public V merge​(V replacing,
                       V update)
        Description copied from interface: UpdateFunction
        Computes the result of merging the existing value with the one from the update.
        Specified by:
        merge in interface UpdateFunction<V,​V>
        Parameters:
        replacing - the value in the original tree we have matched
        update - the value in the updating collection that matched
        Returns:
        the value to insert into the new tree
      • onAllocatedOnHeap

        public void onAllocatedOnHeap​(long heapSize)
        Specified by:
        onAllocatedOnHeap in interface UpdateFunction<V,​V>
        Parameters:
        heapSize - extra heap space allocated (over previous tree)