com.phasmidsoftware.lascala.tree

Created by scalaprof on 11/12/16.

Attributes

Members list

Type members

Classlikes

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class AbstractBinaryTree[+A](left: Node[A], right: Node[A])(using evidence$1: Ordering[A]) extends Branch[A]

Base class for binary trees

Base class for binary trees

Type parameters

A

the underlying type of this binary tree

Value parameters

left

the left node

right

the right node

Attributes

Companion
object
Supertypes
trait Branch[A]
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
Known subtypes
class BinaryTree[A]
abstract class AbstractEmpty extends Tree[Nothing]

Base class for Empty nodes

Base class for Empty nodes

Attributes

Supertypes
trait Tree[Nothing]
trait Node[Nothing]
class Object
trait Matchable
class Any
Known subtypes
object Empty
object AbstractLeaf

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class AbstractLeaf[+A](a: A) extends Node[A]

Abstract base class for a leaf whose value is a

Abstract base class for a leaf whose value is a

Type parameters

A

the underlying type of this Leaf

Value parameters

a

the value of this leaf

Attributes

Companion
object
Supertypes
trait Node[A]
class Object
trait Matchable
class Any
Known subtypes
class IndexedLeaf[A]
class Leaf[A]
case class BinaryTree[+A](a: A, left: Node[A], right: Node[A])(using evidence$1: Ordering[A]) extends AbstractBinaryTree[A]

Case class for a binary tree with a value at each node

Case class for a binary tree with a value at each node

Type parameters

A

the underlying type which must be Orderable.

Value parameters

a

the value of the root node of this binary tree

left

the left-side node

right

the right-side node (assumed to come after the left side node)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Branch[A]
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
object BinaryTree

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
BinaryTree.type
trait Branch[+A] extends Tree[A]

A branch of a tree

A branch of a tree

Type parameters

A

the underlying type of this Branch

Attributes

Companion
object
Supertypes
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Known subtypes
class BinaryTree[A]
class GeneralTree[A]
class KVTree[K, V]
class GeneralKVTree[K, V]
Show all
object Branch

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Branch.type
case object Close extends Punctuation

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Punctuation
trait Node[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
Close.type
case object Empty extends AbstractEmpty

Empty object which is necessary for (non-ideal) BinaryTrees. There should be no need for a GeneralTree to reference an Empty but it might happen.

Empty object which is necessary for (non-ideal) BinaryTrees. There should be no need for a GeneralTree to reference an Empty but it might happen.

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Tree[Nothing]
trait Node[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
Empty.type
case object EmptyWithIndex extends AbstractEmpty, TreeIndex

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait TreeIndex
trait Tree[Nothing]
trait Node[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
case class GeneralKVTree[K, V](value: Option[V], children: List[Node[V]])(implicit vo: ValueOps[K, V]) extends KVTree[K, V]

A general branch of a KV-tree, where there is a value at the node itself and the number of children is unbounded. Parallel to GeneralTree

A general branch of a KV-tree, where there is a value at the node itself and the number of children is unbounded. Parallel to GeneralTree

Type parameters

V

the underlying value type of this GeneralTree

Value parameters

children

the children of this Node

value

the value of the branch

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class KVTree[K, V]
trait StructuralTree[K, V]
trait StructuralNode[K, V]
trait Branch[V]
trait Tree[V]
trait Node[V]
class Object
trait Matchable
class Any
Show all
object GeneralKVTree

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class GeneralKVTreeBuilder[K, V](implicit vo: ValueOps[K, V]) extends TreeBuilder[V]

Base class implementing TreeBuilder for GeneralKVTree

Base class implementing TreeBuilder for GeneralKVTree

Type parameters

K

key type

V

value type

Value parameters

vo

implicit ValueOps

Attributes

Supertypes
trait TreeBuilder[V]
class Object
trait Matchable
class Any
Known subtypes
abstract class GeneralKVTreeBuilderWithScaffolding[K, V](implicit vo: ValueOps[K, V]) extends GeneralKVTreeBuilder[K, V]

Attributes

Supertypes
class GeneralKVTreeBuilder[K, V]
trait TreeBuilder[V]
class Object
trait Matchable
class Any
case class GeneralKVTreeWithScaffolding[K, V](value: Option[V], children: List[Node[V]])(implicit vo: ValueOps[K, V], m: HashMap[K, Node[V]]) extends KVTree[K, V]

A general branch of a KV-tree, where there is a value at the node itself and the number of children is unbounded. Parallel to GeneralTree

A general branch of a KV-tree, where there is a value at the node itself and the number of children is unbounded. Parallel to GeneralTree

Type parameters

V

the underlying value type of this GeneralTree

Value parameters

children

the children of this Node

value

the value of the branch

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class KVTree[K, V]
trait StructuralTree[K, V]
trait StructuralNode[K, V]
trait Branch[V]
trait Tree[V]
trait Node[V]
class Object
trait Matchable
class Any
Show all
object GeneralTree

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class GeneralTree[+A](value: A, children: List[Node[A]]) extends Branch[A]

A general branch of a tree, where there is a value at the node itself and the number of children is unbounded

A general branch of a tree, where there is a value at the node itself and the number of children is unbounded

Type parameters

A

the underlying type of this Branch

Value parameters

children

the children of this Node

value

the value of the branch

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Branch[A]
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
trait GeneralTreeBuilder[A] extends TreeBuilder[A]

Trait implementing TreeBuilder for GeneralTree

Trait implementing TreeBuilder for GeneralTree

Type parameters

A

the underlying type of the Node(s) and Tree

Attributes

Supertypes
trait TreeBuilder[A]
class Object
trait Matchable
class Any
case class IndexedLeaf[A](lIndex: Option[Long], rIndex: Option[Long], value: A) extends AbstractLeaf[A], TreeIndex, IndexedNode[A]

Case class for an indexed leaf

Case class for an indexed leaf

Type parameters

A

the underlying type of this Leaf

Value parameters

lIndex

the (optional) index to the left of the leaf

rIndex

the (optional) index to the right of the leaf

value

the leaf value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IndexedNode[A]
trait TreeIndex
class AbstractLeaf[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
trait IndexedNode[A] extends Node[A], TreeIndex

Trait which combines the Node and TreeIndex traits

Trait which combines the Node and TreeIndex traits

Type parameters

A

the underlying type of the tree/node

Attributes

Companion
object
Supertypes
trait TreeIndex
trait Node[A]
class Object
trait Matchable
class Any
Known subtypes
object IndexedNode

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait IndexedTree[A] extends IndexedNode[A], Tree[A]

Trait which combines the IndexedNode and Tree traits

Trait which combines the IndexedNode and Tree traits

Type parameters

A

the underlying type of this Branch

Attributes

Supertypes
trait Tree[A]
trait IndexedNode[A]
trait TreeIndex
trait Node[A]
class Object
trait Matchable
class Any
Show all
Known subtypes
object KVTree

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
KVTree.type
abstract class KVTree[K, +V]()(implicit vo: ValueOps[K, V]) extends Branch[V], StructuralTree[K, V]

Trait which models the tree-like aspects of a tree

Trait which models the tree-like aspects of a tree

Type parameters

K

the Key type

V

the underlying type of the tree/node values

Value parameters

vo

the (implicit) ValueOps

Attributes

Companion
object
Supertypes
trait StructuralTree[K, V]
trait StructuralNode[K, V]
trait Branch[V]
trait Tree[V]
trait Node[V]
class Object
trait Matchable
class Any
Show all
Known subtypes
object Leaf

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Leaf.type
case class Leaf[+A](a: A) extends AbstractLeaf[A]

Case class for a leaf whose value is a

Case class for a leaf whose value is a

Type parameters

A

the underlying type of this Leaf

Value parameters

a

the value of this leaf

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class AbstractLeaf[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
case class MutableGenericIndexedTree[A](var lIndex: Option[Long], var rIndex: Option[Long], var value: Option[A], var children: List[Node[A]]) extends Branch[A], IndexedTree[A]

A mutable (temporary) tree used as a preliminary to building an MPTT index

A mutable (temporary) tree used as a preliminary to building an MPTT index

Type parameters

A

the underlying type of this Branch

Value parameters

children

the children of this node

lIndex

the (optional) index to the left of the node

rIndex

the (optional) index to the right of the node

value

the leaf value

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait IndexedTree[A]
trait IndexedNode[A]
trait TreeIndex
trait Branch[A]
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
object Node

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Node.type
sealed trait Node[+A]

Trait which models the node of a tree

Trait which models the node of a tree

Type parameters

A

the underlying type of the tree/node

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AbstractLeaf[A]
class IndexedLeaf[A]
class Leaf[A]
trait IndexedNode[A]
trait IndexedTree[A]
class Punctuation
object Close
object Open
trait StructuralNode[K, A]
trait StructuralTree[K, A]
class KVTree[K, V]
class GeneralKVTree[K, V]
trait Tree[A]
object Empty
trait Branch[A]
class BinaryTree[A]
class GeneralTree[A]
Show all
case object Open extends Punctuation

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Punctuation
trait Node[Nothing]
class Object
trait Matchable
class Any
Show all
Self type
Open.type
object Parent

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Parent.type
trait Parent[T]

A trait which expresses parenthood. This defines a type class.

A trait which expresses parenthood. This defines a type class.

Type parameters

T

the underlying type of the Parent

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
abstract class Punctuation(val x: String) extends Node[Nothing]

CONSIDER extending AbstractEmpty

CONSIDER extending AbstractEmpty

Value parameters

x

the String that this punctuation will render as

Attributes

Supertypes
trait Node[Nothing]
class Object
trait Matchable
class Any
Known subtypes
object Close
object Open
trait StringValueOps[V] extends ValueOps[String, V]

Attributes

Supertypes
trait ValueOps[String, V]
trait Ordering[V]
trait PartialOrdering[V]
trait Equiv[V]
trait Serializable
trait Comparator[V]
class Object
trait Matchable
class Any
Show all
sealed trait StructuralNode[K, +A] extends Node[A]

Defines a Node in a tree where the value of any node determines its place within the tree.

Defines a Node in a tree where the value of any node determines its place within the tree.

CONSIDER do we really need A to be covariant?

Type parameters

A

the underlying type of the tree/node

K

the key type

Attributes

Supertypes
trait Node[A]
class Object
trait Matchable
class Any
Known subtypes
trait StructuralTree[K, A]
class KVTree[K, V]
class GeneralKVTree[K, V]

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait StructuralTree[K, +A] extends Tree[A], StructuralNode[K, A]

Trait which models the tree-like aspects of a structural tree. This kind of tree is distinguishable from an ordinary Tree by the fact that the methods take an implicit parameter of type ValueOps. This parameter allows for the values themselves to imply a position within the tree, in other words a tree which could be faithfully rebuilt from itself.

Trait which models the tree-like aspects of a structural tree. This kind of tree is distinguishable from an ordinary Tree by the fact that the methods take an implicit parameter of type ValueOps. This parameter allows for the values themselves to imply a position within the tree, in other words a tree which could be faithfully rebuilt from itself.

CONSIDER requiring that the ValueOps parameter be a property of the StructuralTree itself.

Type parameters

A

the underlying type of the tree/node

K

the key type

Attributes

Companion
object
Supertypes
trait StructuralNode[K, A]
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all
Known subtypes
class KVTree[K, V]
class GeneralKVTree[K, V]
object Tree

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Tree.type
sealed trait Tree[+A] extends Node[A]

Trait which models the tree-like aspects of a tree

Trait which models the tree-like aspects of a tree

Type parameters

A

the underlying type of the tree/node

Attributes

Companion
object
Supertypes
trait Node[A]
class Object
trait Matchable
class Any
Known subtypes
object Empty
trait Branch[A]
class BinaryTree[A]
class GeneralTree[A]
class KVTree[K, V]
class GeneralKVTree[K, V]
trait IndexedTree[A]
trait StructuralTree[K, A]
Show all
object TreeBuilder

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait TreeBuilder[A]

Trait to define a method for building a tree from a Node. CONSIDER making this trait covariant in A

Trait to define a method for building a tree from a Node. CONSIDER making this trait covariant in A

Type parameters

A

the underlying type of the Node(s) and Tree

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class TreeException(msg: String, cause: Throwable = ...) extends Exception

The exception class for Trees

The exception class for Trees

Value parameters

cause

the cause (defaults to null)

msg

the message to be yielded by the exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
sealed trait TreeIndex

Trait which models an index that is useful for building an indexed tree, especially an MPTT-type index.

Trait which models an index that is useful for building an indexed tree, especially an MPTT-type index.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class IndexedLeaf[A]
trait IndexedNode[A]
trait IndexedTree[A]
case class UnvaluedBinaryTree[+A](left: Node[A], right: Node[A])(using evidence$1: Ordering[A]) extends AbstractBinaryTree[A]

Case class for a binary tree where the nodes themselves do not have values

Case class for a binary tree where the nodes themselves do not have values

Type parameters

A

the underlying type which must be Orderable.

Value parameters

left

the left-side node

right

the right-side node (assumed to come after the left side node)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Branch[A]
trait Tree[A]
trait Node[A]
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
trait ValueOps[K, V] extends Ordering[V]

This trait is implemented by a type class which pertains to the underlying VALUE type of a tree. It does not pertain to the shape of the tree.

This trait is implemented by a type class which pertains to the underlying VALUE type of a tree. It does not pertain to the shape of the tree.

Type parameters

K

the key type

V

the value type

Attributes

Supertypes
trait Ordering[V]
trait PartialOrdering[V]
trait Equiv[V]
trait Serializable
trait Comparator[V]
class Object
trait Matchable
class Any
Show all
Known subtypes
trait StringValueOps[V]

Types

type NodeSeq[A] = Seq[Node[A]]