object Decorators
Decorators are higher-order operations that provide common patterns of tree attribution based on simple attributes or functions.
- Source
- Decorators.scala
- Alphabetic
- By Inheritance
- Decorators
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Chain
[T, U](in: (T) ⇒ U, out: (T) ⇒ U) extends (T) ⇒ U with Product with Serializable
A pair of attributes that thread through a tree in a depth-first left-to-right fashion.
A pair of attributes that thread through a tree in a depth-first left-to-right fashion. The
in(out) attributes provides the value of the chain as it enters a node from above (leaves a node to the above).
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
atRoot[T <: Attributable, U](a: (T) ⇒ U): Attribution.CachedAttribute[T, U]
A decorator that progagates an attribute value down the tree.
A decorator that progagates an attribute value down the tree. The partial function
ashould define the value of the attribute at the root. The value defined at the root will also be made available at all other nodes. -
def
chain[T <: Attributable, U](inupdate: ((T) ⇒ U) ⇒ ==>[T, U] = idf[T,U], outupdate: ((T) ⇒ U) ⇒ ==>[T, U] = idf[T,U]): Chain[T, U]
Create a new attribute chain.
Create a new attribute chain. The
updatefunctions provide ways to influence the chain value, by taking the default computation of theinoroutattribute and returning a partial function. If the domain of the partial function contains a node, then that function is used to compute the chain value at the node n, otherwise the default chain attribute is used. If an update function is omitted, it defaults to the identity.If the root of the tree is reached without a definition being supplied for the chain, a runtime exception is thrown. Both of the components of the chain are reset to avoid errors for cyclic if the exception is caught and they are subsequently evaluated again.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
down[T <: Attributable, U](default: U)(a: ==>[T, U]): Attribution.CachedAttribute[T, U]
Variant of
downthat takes a default value instead of a default function. -
def
down[T <: Attributable, U](default: (T) ⇒ U)(a: ==>[T, U]): Attribution.CachedAttribute[T, U]
A decorator that propagates an attribute value down the tree.
A decorator that propagates an attribute value down the tree. The partial function
ashould define the value of the attribute at nodes where it is known. Ifadoes not define a value for the attribute at a particular node, then the decorator asks the parent of the node for its value of the attribute and uses that value. If no node on the path to the root defines a value for the attribute, then default applied to the root is returned. -
def
downErr[T <: Attributable, U](a: ==>[T, U]): Attribution.CachedAttribute[T, U]
Variant of
downthat throws an error ifais not defined on the path to the root of the tree. -
def
downOpt[T <: Attributable, U](a: ==>[T, U]): Attribution.CachedAttribute[T, Option[U]]
Variant of
downthat returnsNoneifais not defined on the path to the root of the tree, otherwise it wraps the value thatareturns inSome. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )