public final class MakeTree<V,A>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
FingerTree<V,A> |
deep(Digit<V,A> prefix,
FingerTree<V,Node<V,A>> middle,
Digit<V,A> suffix)
Constructs a deep tree.
|
FingerTree<V,A> |
deep(V v,
Digit<V,A> prefix,
FingerTree<V,Node<V,A>> middle,
Digit<V,A> suffix)
Constructs a deep tree with the given annotation value.
|
FingerTree<V,A> |
empty()
Constructs an empty tree.
|
Four<V,A> |
four(A a,
A b,
A c,
A d)
A digit of four elements.
|
Node2<V,A> |
node2(A a,
A b)
A binary tree node.
|
Node2<V,A> |
node2(V2<A> v)
A binary tree node
|
Node3<V,A> |
node3(A a,
A b,
A c)
A trinary tree node.
|
Node3<V,A> |
node3(V3<A> v)
A trinary tree node
|
One<V,A> |
one(A a)
A digit of one element.
|
FingerTree<V,A> |
single(A a)
Constructs a singleton tree.
|
Three<V,A> |
three(A a,
A b,
A c)
A digit of three elements.
|
Two<V,A> |
two(A a,
A b)
A digit of two elements.
|
public FingerTree<V,A> empty()
public FingerTree<V,A> single(A a)
a
- A single element for the tree.public FingerTree<V,A> deep(Digit<V,A> prefix, FingerTree<V,Node<V,A>> middle, Digit<V,A> suffix)
prefix
- The leftmost elements of the tree.middle
- The subtree, which is a Finger Tree of 2-3 nodes.suffix
- The rightmost elements of the tree.public FingerTree<V,A> deep(V v, Digit<V,A> prefix, FingerTree<V,Node<V,A>> middle, Digit<V,A> suffix)
v
- The value with which to annotate this tree.prefix
- The leftmost elements of the tree.middle
- The subtree, which is a Finger Tree of 2-3 nodes.suffix
- The rightmost elements of the tree.public One<V,A> one(A a)
a
- The element of the digit.public Two<V,A> two(A a, A b)
a
- The first element of the digit.b
- The second element of the digit.public Three<V,A> three(A a, A b, A c)
a
- The first element of the digit.b
- The second element of the digit.c
- The third element of the digit.public Four<V,A> four(A a, A b, A c, A d)
a
- The first element of the digit.b
- The second element of the digit.c
- The third element of the digit.d
- The fifth element of the digit.public Node2<V,A> node2(A a, A b)
a
- The left child of the node.b
- The right child of the node.public Node3<V,A> node3(A a, A b, A c)
a
- The left child of the node.b
- The middle child of the node.c
- The right child of the node.public Node2<V,A> node2(V2<A> v)
v
- A vector of the node's elements.