Package

org.bitbucket.inkytonik.kiama

relation

Permalink

package relation

Visibility
  1. Public
  2. All

Type Members

  1. case class Bridge[T](cross: T) extends Product with Serializable

    Permalink

    A bridge node in a tree structure which connects to another structure.

    A bridge node in a tree structure which connects to another structure. Bridges are not traversed when determining the tree structure.

  2. case class NodeNotInTreeException[T](t: T) extends Exception with Product with Serializable

    Permalink

    Exception thrown if a TreeRelation operation tries to use a node that is not in the tree to which the relation applies.

    Exception thrown if a TreeRelation operation tries to use a node that is not in the tree to which the relation applies.

    For the time-being, the exception does not indicate which tree is involved because it's not clear how to identify the tree briefly in a short message. The stack trace that accompanies the exception should be sufficient.

  3. class Relation[T, U] extends RelationLike[T, U, Relation]

    Permalink

    A binary relation between values of type T and values of type U.

    A binary relation between values of type T and values of type U. Constructed from a vector of pairs that constitute the relation's graph.

  4. trait RelationFactory[Repr[_, _]] extends AnyRef

    Permalink

    Interface for factories that can create relations.

    Interface for factories that can create relations. Repr is the representation type of the relations that the factory produces.

  5. trait RelationLike[T, U, Repr[_, _]] extends AnyRef

    Permalink

    A template trait for Relation-like types.

    A template trait for Relation-like types. T and U are the domain and range types of the relation, respectively. Repr is the type constructor for the concrete representation of a particular relation type.

  6. class Tree[T <: Product, +R <: T] extends AnyRef

    Permalink

    Relational representations of trees built out of hierarchical Product instances.

    Relational representations of trees built out of hierarchical Product instances. Typically, the nodes are instances of case classes.

    The type T is the common base type of the tree nodes. The type R is a sub-type of T that is the type of the root node.

    The originalRoot value should be the root of a finite, acyclic structure that contains only Product instances of type T (unless they are skipped, see below). If the structure reachable from originalRoot is actually a tree (i.e., contains no shared nodes) then the field root will be the same as originalRoot.

    On the other hand, if the structure contains shared nodes, then root will be the root of a new structure which duplicates the original structure but removes the sharing. In other words, shared nodes will be copied.

    The child relation of a tree is defined to skip certain nodes. Specifically, if a node of type T is wrapped in a Some of an option, a Left or Right of an Either, a tuple up to size four, or a TraversableOnce, then those wrappers are ignored. E.g., if t1 is Some (t2) where both t1 and t2 are of type T, then t1 will be t2's parent, not the Some value.

    Thanks to Len Hamey for the idea to use lazy cloning to restore the tree structure instead of requiring that the input trees contain no sharing.

Value Members

  1. object Relation extends RelationFactory[Relation]

    Permalink

    Factory for binary relations.

  2. object Tree

    Permalink

    Companion object for trees.

Ungrouped