Class MemoizeCache<T>

java.lang.Object
arez.component.internal.MemoizeCache<T>
All Implemented Interfaces:
Disposable

public final class MemoizeCache<T> extends Object implements Disposable
The class responsible for caching
  • Constructor Details

  • Method Details

    • get

      public T get(@Nonnull Object... args)
      Return the result of the memoized function, calculating if necessary.
      Parameters:
      args - the arguments passed to the memoized function.
      Returns:
      the result of the memoized function.
    • isDisposed

      public boolean isDisposed()
      Description copied from interface: Disposable
      Return true if dispose() has been called on object.
      Specified by:
      isDisposed in interface Disposable
      Returns:
      true if dispose has been called.
    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Dispose the element. See Disposable for a description of the implications.
      Specified by:
      dispose in interface Disposable
    • getComputableValue

      @Nonnull public ComputableValue<T> getComputableValue(@Nonnull Object... args)
      Retrieve the computable value for specified parameters, creating it if necessary.
      Parameters:
      args - the arguments passed to the memoized function.
      Returns:
      the computable value instance for the specified args.