Class

org.bitbucket.inkytonik.kiama.attribution.AttributionCore

CachedDynamicAttribute

Related Doc: package AttributionCore

Permalink

class CachedDynamicAttribute[T, U] extends CachedAttribute[T, U]

A cached dynamic attribute of a node type T with value of type U, supported by a memo table and circularity test. The value of the attribute is initially computed by the function f, but the definition can be augmented dynamically. The result is memoised so that it is only evaluated once for a given definition. The attribute definition should not itself require the value of this attribute. If it does, a circularity error is reported by throwing an IllegalStateException. This kind of attribute encapsulates state to keep track of the current definition, so an instance should only be used from one thread at a time.

Source
AttributionCore.scala
Linear Supertypes
CachedAttribute[T, U], Attribute[T, U], (T) ⇒ U, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CachedDynamicAttribute
  2. CachedAttribute
  3. Attribute
  4. Function1
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CachedDynamicAttribute(name: String, f: (T) ⇒ U)

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +=(g: ==>[T, U]): Unit

    Permalink

    Add a new partial function to the definition of this attribute.

    Add a new partial function to the definition of this attribute. Resets the memo table for this attribute.

  4. def -=(g: ==>[T, U]): Unit

    Permalink

    Remove a partial function from the definition of this attribute, if it's there, otherwise have no effect.

    Remove a partial function from the definition of this attribute, if it's there, otherwise have no effect. If g appears more than once in the definition, just remove the first one. Resets the memo table for this attribute.

  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def andThen[A](g: (U) ⇒ A): (T) ⇒ A

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  7. def apply(t: T): U

    Permalink

    Return the value of this attribute for node t, raising an error if it depends on itself.

    Return the value of this attribute for node t, raising an error if it depends on itself. If the value has been memoised, return it. Otherwise, the functions list is tried in order. The first partial function on that list that is defined will be used. If no partial function on this list is defined, then f will be used.

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

    Permalink
    Definition Classes
    Any
  9. def block(b: ⇒ Any): Unit

    Permalink

    Execute a block and restore the state of this dynamic attribute after the block has executed.

    Execute a block and restore the state of this dynamic attribute after the block has executed. The idea is that the block can add to the definition of the attribute for use within the block. Any definitions that are added will be automatically removed at the end of the block.

  10. def clone(): AnyRef

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

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. val functions: ListBuffer[PartialFunction[T, U]]

    Permalink

    List of functions that currently dynamically define this attribute.

  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hasBeenComputedAt(t: T): Boolean

    Permalink

    Has the value of this attribute at t already been computed or not? If the table contains Some (u) then we've computed it and the value was u.

    Has the value of this attribute at t already been computed or not? If the table contains Some (u) then we've computed it and the value was u. If the memo table contains None we are in the middle of computing it. Otherwise the memo table contains no entry for t.

    Definition Classes
    CachedAttribute
  18. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  20. val memo: Memoiser[T, Option[U]]

    Permalink

    Backing memo table.

    Backing memo table.

    Definition Classes
    CachedAttribute
  21. val name: String

    Permalink
    Definition Classes
    Attribute
  22. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  25. def reportCycle(t: T): U

    Permalink

    Report a cycle in the calculation of this attribute discovered when evaluating the attribute on value t.

    Report a cycle in the calculation of this attribute discovered when evaluating the attribute on value t. Throws an IllegalStateException.

    Definition Classes
    Attribute
  26. def reset(): Unit

    Permalink

    Reset the cache for this attribute.

    Reset the cache for this attribute.

    Definition Classes
    CachedAttribute
  27. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink

    The attribute's string representation is its name.

    The attribute's string representation is its name.

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

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

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

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

Inherited from CachedAttribute[T, U]

Inherited from Attribute[T, U]

Inherited from (T) ⇒ U

Inherited from AnyRef

Inherited from Any

Ungrouped