Class UpdateFunction.Simple<V>

  • All Implemented Interfaces:
    com.google.common.base.Function<V,​V>, java.util.function.Function<V,​V>, UpdateFunction<V,​V>
    Enclosing interface:
    UpdateFunction<K,​V>

    public static final class UpdateFunction.Simple<V>
    extends java.lang.Object
    implements UpdateFunction<V,​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
      boolean abortEarly()  
      void allocated​(long heapSize)  
      V apply​(V v)  
      V apply​(V replacing, V update)  
      static <V> UpdateFunction.Simple<V> of​(java.util.function.BiFunction<V,​V,​V> f)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.google.common.base.Function

        equals
      • Methods inherited from interface java.util.function.Function

        andThen, compose
    • Constructor Detail

      • Simple

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

      • apply

        public V apply​(V v)
        Specified by:
        apply in interface com.google.common.base.Function<V,​V>
        Specified by:
        apply in interface java.util.function.Function<V,​V>
      • apply

        public V apply​(V replacing,
                       V update)
        Specified by:
        apply 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
      • abortEarly

        public boolean abortEarly()
        Specified by:
        abortEarly in interface UpdateFunction<V,​V>
        Returns:
        true if we should fail the update
      • allocated

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