Package org.basex.query.util.fingertree
Class FingerTreeBuilder<E>
java.lang.Object
org.basex.query.util.fingertree.FingerTreeBuilder<E>
- Type Parameters:
E- element type
- All Implemented Interfaces:
Iterable<E>
A builder for
FingerTrees from leaf nodes.- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(FingerTree<E, E> tree) Appends another finger tree to this builder.voidAdds a leaf node to the back of the tree.FingerTree<E,E> freeze()Builds a finger tree from the current state of this builder.booleanisEmpty()Checks if this builder is empty, i.e.iterator()voidAdds a leaf node to the front of the tree.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FingerTreeBuilder
public FingerTreeBuilder()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if this builder is empty, i.e. if no leaf nodes were added to it.- Returns:
trueif the builder is empty,falseotherwise
-
prepend
Adds a leaf node to the front of the tree.- Parameters:
leaf- the leaf node to add
-
append
Adds a leaf node to the back of the tree.- Parameters:
leaf- the leaf node to add
-
append
Appends another finger tree to this builder.- Parameters:
tree- finger tree to append
-
freeze
Builds a finger tree from the current state of this builder.- Returns:
- the resulting finger tree
-
toString
-
iterator
-