kiama.attribution.Attribution

class CachedAttribute

[source: kiama/attribution/Attribution.scala]

class CachedAttribute[T <: AnyRef, U](f : scala.PartialFunction[T, U])
extends scala.PartialFunction[T, U]
An 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 computed by the function f. The result is memoised so that it is only evaluated once. f should not itself require the value of this attribute. If it does, a circularity error is reported.
Method Summary
def apply (t : T) : U
Return the value of this attribute for node t, raising an error if it depends on itself.
def isDefinedAt (t : T) : Boolean
A cached attribute is defined at the same places as its defining function.
Methods inherited from scala.PartialFunction
scala.PartialFunction.orElse, scala.PartialFunction.andThen
Methods inherited from scala.Function1
scala.Function1.toString, scala.Function1.compose
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def apply(t : T) : U
Return the value of this attribute for node t, raising an error if it depends on itself.

def isDefinedAt(t : T) : Boolean
A cached attribute is defined at the same places as its defining function.
Overrides
scala.PartialFunction.scala.PartialFunction.isDefinedAt