EmptyWithIndex
Attributes
- Graph
-
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalstrait TreeIndexclass AbstractEmptytrait Tree[Nothing]trait Node[Nothing]class Objecttrait Matchableclass AnyShow all
- Self type
-
EmptyWithIndex.type
Members list
Type members
Inherited types
The names of the product elements.
The names of the product elements.
Attributes
- Inherited from:
- Singleton
Attributes
- Inherited from:
- Singleton
The mirrored *-type.
The mirrored *-type.
Attributes
- Inherited from:
- Singleton
Attributes
- Inherited from:
- Singleton
Inherited and Abstract types
The name of the type.
The name of the type.
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
the left index (the number of other nodes to the "left" of this one
the left index (the number of other nodes to the "left" of this one
Attributes
the right index (the number of other nodes to the "right" of this one
the right index (the number of other nodes to the "right" of this one
Attributes
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
Inherited methods
Method to add the given node to this node
Method to add the given node to this node
Type parameters
- B
-
the underlying type of the new node (and the resulting tree)
Value parameters
- b
-
the value to add, as a Leaf
Attributes
- Returns
-
the resulting tree
- Inherited from:
- Tree
Method to add the given node to this node.
Method to add the given node to this node.
Type parameters
- B
-
the underlying type of the new node (and the resulting tree)
Value parameters
- node
-
the node to add
Attributes
- Returns
-
the resulting tree
- Inherited from:
- Tree
Attributes
- Returns
-
the immediate descendants (children) of this branch
- Inherited from:
- AbstractEmpty
Method to determine if this Node's value is equal to node n's value WITHOUT any recursion.
Method to determine if this Node's value is equal to node n's value WITHOUT any recursion.
Type parameters
- B
-
the underlying type of n
Value parameters
- n
-
the node to be compared
Attributes
- Returns
-
true if this is "like" n
- Inherited from:
- Node
NOTE: that this is NOT tail-recursive
NOTE: that this is NOT tail-recursive
NOTE: I don't think we can use Parent.traverse for depth. Could be wrong.
Attributes
- Returns
-
the depth of the subtree
- Inherited from:
- Tree
Type parameters
- B
-
the type of b
Value parameters
- p
-
the predicate to be applied to the value of each node in turn (depth first)
Attributes
- Returns
-
Some(node) where node is the first node to be found that satisfies the predicate p
- Inherited from:
- Tree
Type parameters
- B
-
the type of b
Value parameters
- b
-
value to be found, looking at the value of each node in turn (depth first)
Attributes
- Returns
-
Some(node) where node is the first node to be found with value b
- Inherited from:
- Tree
Creates a new instance of type T with elements taken from product p.
Creates a new instance of type T with elements taken from product p.
Attributes
- Inherited from:
- Singleton
Attributes
- Returns
-
the value of this node, if any
- Inherited from:
- AbstractEmpty
Determine if this tree has a subtree matching b which includes c
Determine if this tree has a subtree matching b which includes c
Type parameters
- B
-
the type of subtree and element
Value parameters
- element
-
the value of the element to be found in the subtree
- subtree
-
the value of the subtree to be searched
Attributes
- Returns
-
true if value element is found in the sub-tree defined by subtree
- Inherited from:
- Tree
Method to determine if this Tree includes the given node
Method to determine if this Tree includes the given node
Type parameters
- B
-
the underlying type of n
Value parameters
- node
-
the node to be searched for
Attributes
- Returns
-
true if node n is found in the sub-tree defined by this
- Inherited from:
- Tree
Determine if this subtree includes a value equal to b
Determine if this subtree includes a value equal to b
CONSIDER renaming this back to just includes (as it was previously)
Type parameters
- B
-
the type of b
Value parameters
- b
-
the value to be searched
Attributes
- Returns
-
true if value b is found in the sub-tree defined by this
- Inherited from:
- Tree
Method to determine if this Node is a leaf or a branch node
Method to determine if this Node is a leaf or a branch node
Attributes
- Returns
-
true if this Node is a leaf
- Inherited from:
- Node
Iterate on the values of this tree
Iterate on the values of this tree
Value parameters
- depthFirst
-
if true then we iterate depth-first, else breadth-first (defaults to true)
Attributes
- Returns
-
an iterator of values
- Inherited from:
- Tree
Method to determine if this subtree is "like" the given node (without recursion)
Method to determine if this subtree is "like" the given node (without recursion)
Type parameters
- B
-
the underlying type of n
Value parameters
- node
-
the node to be searched for
Attributes
- Returns
-
true if node n is found in the sub-tree defined by this
- Inherited from:
- Tree
Iterate on the nodes which are the descendants of this node (including this node at start or end of result)
Iterate on the nodes which are the descendants of this node (including this node at start or end of result)
Value parameters
- depthFirst
-
if true then we iterate depth-first, else breadth-first (defaults to true)
Attributes
- Returns
-
an iterator of nodes
- Inherited from:
- AbstractEmpty
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Method to replace a particular node in this tree with another node, but otherwise return a copy of this tree.
Method to replace a particular node in this tree with another node, but otherwise return a copy of this tree.
CONSIDER moving this into Tree since it isn't really a Node method
Type parameters
- B
-
the underlying type of the new node (and the resulting tree)
Value parameters
- f
-
function to determine if two nodes are the same
- x
-
the node to be replaced with y
- y
-
the node to replace x
Attributes
- Returns
-
the resulting tree
- Inherited from:
- Node
Calculate the size of this node's subtree
Calculate the size of this node's subtree
Attributes
- Returns
-
the size of the subtree
- Inherited from:
- Tree