org.scaladebugger.api.utils

Memoization

class Memoization[I, K, O] extends (I) ⇒ O

Represents a generic form of memoization. Modified from Pathikrit Bhowmick's copy of Scala Memoization.

I

Represents the input to the memoized function

K

Represents the type of key to use for cached results

O

Represents the output of the memoized function

See also

https://github.com/pathikrit/scalgos/blob/master/src/main/scala/com/github/pathikrit/scalgos/Memo.scala

Linear Supertypes
(I) ⇒ O, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Memoization
  2. Function1
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Memoization(memoFunc: (I) ⇒ O, cacheInvalidFunc: (K) ⇒ Boolean = ((x$1: K) => false), cache: Map[K, O] = ...)(implicit convertToKey: (I) ⇒ K)

    memoFunc

    Represents the function that will be memoized

    cacheInvalidFunc

    Represents a function that, if it yields true, will mark the current cache element represented by K as invalid and rerun the memo function

    cache

    The map used to store the cache of results to be fed back as a result of memoization

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def andThen[A](g: (O) ⇒ A): (I) ⇒ A

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  7. def apply(input: I): O

    Executes the memoized function if the given input is new, otherwise returns the result from a previous execution.

    Executes the memoized function if the given input is new, otherwise returns the result from a previous execution.

    input

    The input to execute upon

    returns

    The result of the execution

    Definition Classes
    Memoization → Function1
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clear(): Unit

    Clears the internal memoization, allowing new results to be calculated from previously-used input.

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def compose[A](g: (A) ⇒ I): (A) ⇒ O

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  23. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from (I) ⇒ O

Inherited from AnyRef

Inherited from Any

Ungrouped