Class/Object

cogdebugger

Memoize

Related Docs: object Memoize | package cogdebugger

Permalink

class Memoize[-ArgType, +ReturnType] extends (ArgType) ⇒ ReturnType

A utility class for building memoized functions. Initially an empty (mutable) Map, the first call to apply with a particular key uses the function argument to produce a value and store it in the map before returning it. Subsequent re-use of this key will return the stored value.

Note that the underlying data structure is a scala.collection.mutable.HashMap, which may not be thread-safe.

Created by gonztobi on 2/25/14.

Linear Supertypes
(ArgType) ⇒ ReturnType, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Memoize
  2. Function1
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Memoize(function: (ArgType) ⇒ ReturnType)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (ReturnType) ⇒ A): (ArgType) ⇒ A

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. def apply(key: ArgType): ReturnType

    Permalink
    Definition Classes
    Memoize → Function1
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def compose[A](g: (A) ⇒ ArgType): (A) ⇒ ReturnType

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def isDefinedAt(key: ArgType): Boolean

    Permalink
  15. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from (ArgType) ⇒ ReturnType

Inherited from AnyRef

Inherited from Any

Ungrouped