org.jetbrains.jet.storage
Interface StorageManager

All Known Subinterfaces:
LazyResolveStorageManager
All Known Implementing Classes:
LockBasedLazyResolveStorageManager, LockBasedStorageManager

public interface StorageManager


Method Summary
<T> T
compute(jet.Function0<T> computable)
           
<T>
createLazyValue(jet.Function0<T> computable)
           
<T>
createLazyValueWithPostCompute(jet.Function0<T> computable, jet.Function1<java.lang.Boolean,T> onRecursiveCall, jet.Function1<T,jet.Unit> postCompute)
           
<K,V>
createMemoizedFunction(jet.Function1<K,V> compute)
          Given a function compute: K -> V create a memoized version of it that computes a value only once for each key
<K,V>
createMemoizedFunctionWithNullableValues(jet.Function1<K,V> compute)
           
<T>
createNullableLazyValue(jet.Function0<T> computable)
           
<T>
createNullableLazyValueWithPostCompute(jet.Function0<T> computable, jet.Function1<T,jet.Unit> postCompute)
          postCompute is called after the value is computed, but before any other thread sees it (the current thread may see it in between)
<T>
createRecursionTolerantLazyValue(jet.Function0<T> computable, T onRecursiveCall)
           
<T>
createRecursionTolerantNullableLazyValue(jet.Function0<T> computable, T onRecursiveCall)
           
 

Method Detail

createMemoizedFunction

@NotNull
<K,V>  createMemoizedFunction(@NotNull
                                           jet.Function1<K,V> compute)
Given a function compute: K -> V create a memoized version of it that computes a value only once for each key

Parameters:
compute - the function to be memoized
valuesReferenceKind - how to store the memoized values NOTE: if compute() has side-effects the WEAK reference kind is dangerous: the side-effects will be repeated if the value gets collected and then re-computed

createMemoizedFunctionWithNullableValues

@NotNull
<K,V>  createMemoizedFunctionWithNullableValues(@NotNull
                                                             jet.Function1<K,V> compute)

createLazyValue

@NotNull
<T>  createLazyValue(@NotNull
                                  jet.Function0<T> computable)

createRecursionTolerantLazyValue

@NotNull
<T>  createRecursionTolerantLazyValue(@NotNull
                                                   jet.Function0<T> computable,
                                                   @NotNull
                                                   T onRecursiveCall)

createLazyValueWithPostCompute

@NotNull
<T>  createLazyValueWithPostCompute(@NotNull
                                                 jet.Function0<T> computable,
                                                 @Nullable
                                                 jet.Function1<java.lang.Boolean,T> onRecursiveCall,
                                                 @NotNull
                                                 jet.Function1<T,jet.Unit> postCompute)
Parameters:
onRecursiveCall - is called if the computation calls itself recursively. The parameter to it is true for the first call, false otherwise. If onRecursiveCall is null, an exception will be thrown on a recursive call, otherwise it's executed and its result is returned
postCompute - is called after the value is computed, but before any other thread sees it

createNullableLazyValue

@NotNull
<T>  createNullableLazyValue(@NotNull
                                          jet.Function0<T> computable)

createRecursionTolerantNullableLazyValue

@NotNull
<T>  createRecursionTolerantNullableLazyValue(@NotNull
                                                           jet.Function0<T> computable,
                                                           @Nullable
                                                           T onRecursiveCall)

createNullableLazyValueWithPostCompute

@NotNull
<T>  createNullableLazyValueWithPostCompute(@NotNull
                                                         jet.Function0<T> computable,
                                                         @NotNull
                                                         jet.Function1<T,jet.Unit> postCompute)
postCompute is called after the value is computed, but before any other thread sees it (the current thread may see it in between)


compute

<T> T compute(@NotNull
              jet.Function0<T> computable)