Class

xyz.hyperreal.btree

MemoryBPlusTree

Related Doc: package btree

Permalink

class MemoryBPlusTree[K, V] extends BPlusTree[K, V]

An in-memory B+ Tree implementation.

K

the type of the keys contained in this map.

V

the type of the values associated with the keys.

Linear Supertypes
BPlusTree[K, V], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MemoryBPlusTree
  2. BPlusTree
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MemoryBPlusTree(order: Int)(implicit arg0: (K) ⇒ Ordered[K])

    Permalink

    creates an in-memory B+ Tree with a branching factor of order.

    creates an in-memory B+ Tree with a branching factor of order.

    order

    the branching factor (maximum number of branches in an internal node) of the tree

Type Members

  1. class InternalNode[K, V] extends Node[K, V]

    Permalink
    Attributes
    protected
  2. class LeafNode[K, V] extends Node[K, V]

    Permalink
    Attributes
    protected
  3. type N = Node[K, V]

    Permalink

    Abstract node type.

    Abstract node type. For in-memory implementations this would probably be the actual node class and for on-disk it would likely be the file pointer where the node is stored.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
    Note

    Comparing two nodes for equality is required to be true when they point to the same node.

  4. abstract class Node[K, V] extends AnyRef

    Permalink
    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addBranch(node: Node[K, V], branch: Node[K, V]): Unit

    Permalink

    Adds a new branch to (internal) node.

    Adds a new branch to (internal) node. branch is placed at an index equal to the length of node, given that the length of a node is the number of keys.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  5. def addKey(node: Node[K, V], key: K): Unit

    Permalink

    Adds a new key to node.

    Adds a new key to node. The length of node will increase by one as a result. This method should be called before either addBranch or addValue since those methods use the current node length to determine placemenet.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def binarySearch(node: N, target: K): Int

    Permalink

    Performs a binary search for key target within node (tail recursively).

    Performs a binary search for key target within node (tail recursively).

    returns

    the index of target within node if it exists, or (-insertionPoint - 1) where insertionPoint is the index of the correct insertion point for key target.

    Attributes
    protected
    Definition Classes
    BPlusTree
  8. def boundedIterator(bounds: (Symbol, K)*): Iterator[(K, V)]

    Permalink

    Returns a bounded iterator over a range of key/value pairs in the tree in ascending sorted key order.

    Returns a bounded iterator over a range of key/value pairs in the tree in ascending sorted key order. The range of key/value pairs in the iterator is specified by bounds. bounds must contain one or two pairs where the first element in the pair is a symbol corresponding to the type of bound (i.e. '<, '<=, '>, '>=) and the second element is a key value.

    An example of a bounded iterator over all elements in a tree (with String keys) that will include all keys that sort greater than or equal to "a" and up to but not including "e" is boundedIterator( ('>=, "a"), ('<, "e") ).

    Definition Classes
    BPlusTree
  9. def boundedKeysIterator(bounds: (Symbol, K)*): Iterator[K]

    Permalink

    Returns a bounded iterator over a range of keys in the tree in ascending sorted key order.

    Returns a bounded iterator over a range of keys in the tree in ascending sorted key order. The bounds parameter is the same as for boundedIterator.

    Definition Classes
    BPlusTree
  10. def boundedPositionIterator(bounds: (Symbol, K)*): Iterator[(N, Int)]

    Permalink

    Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in ascending sorted key order.

    Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in ascending sorted key order. The bounds parameter is the same as for boundedIterator.

    Attributes
    protected
    Definition Classes
    BPlusTree
  11. def boundedValuesIterator(bounds: (Symbol, K)*): Iterator[V]

    Permalink

    Returns a bounded iterator over a range of values in the tree in ascending sorted key order.

    Returns a bounded iterator over a range of values in the tree in ascending sorted key order. The bounds parameter is the same as for boundedIterator.

    Definition Classes
    BPlusTree
  12. def build(s: String): BPlusTree[K, V]

    Permalink

    Returns a B+ tree build from a string representation of the tree.

    Returns a B+ tree build from a string representation of the tree. The syntax of the input string is simple: internal nodes are coded as lists of nodes alternating with keys (alpha strings with no quotation marks) using parentheses with elements separated by space, leaf nodes are coded as lists of alpha strings (no quotation marks) using brackets with elements separated by space.

    Definition Classes
    BPlusTree
    Example:
    1. (
        [g] j [j t] u [u v]
      )

      produces a tree that pretty prints as

      [n0: (null, null, null) n1 | j | n2 | u | n3]
      [n1: (null, n0, n2) g] [n2: (n1, n0, n3) j t] [n3: (n2, n0, null) u v]
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def delete(key: K): Boolean

    Permalink

    Performs the B+ tree deletion algorithm to remove key and it's associated value from the tree, rebalancing the tree if necessary.

    Performs the B+ tree deletion algorithm to remove key and it's associated value from the tree, rebalancing the tree if necessary.

    returns

    true if key was found (and therefore removed), false otherwise

    Definition Classes
    BPlusTree
  15. def diagram(name: String): Unit

    Permalink

    Creates a PNG image file called name (with .png added) which visually represents the structure and contents of the tree, only showing the keys.

    Creates a PNG image file called name (with .png added) which visually represents the structure and contents of the tree, only showing the keys. This method uses GraphViz (specifically the dot command) to produce the diagram, and ImageMagik (specifically the convert command) to convert it from SVG to PNG. dot can product PNG files directly but I got better results producing SVG and converting to PNG.

    Definition Classes
    BPlusTree
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. var first: Node[K, V]

    Permalink

    First leaf node.

    First leaf node. Implementations are required to set this as well as to create/update the in-storage copy of this if needed (only really applies to on-disk implementations) within the implementation's newRoot method. The methods in this class will take care of updating this variable, implementations only need to worry about the in-storage copy.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  20. def freeKey(node: N, index: Int): Unit

    Permalink

    Free the storage previously allocated for the key at index in node.

    Free the storage previously allocated for the key at index in node. For in-memory implementations, this method probably won't do anything.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  21. def freeNode(node: Node[K, V]): Unit

    Permalink

    Free the storage previously allocated for node.

    Free the storage previously allocated for node. For in-memory implementations, this method probably won't do anything.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  22. def freeValue(node: N, index: Int): Unit

    Permalink

    Free the storage previously allocated for the value at index in node.

    Free the storage previously allocated for the value at index in node. For in-memory implementations, this method probably won't do anything.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  23. def getBranch(n: Node[K, V], index: Int): Node[K, V]

    Permalink

    Returns a branch pointer from an internal node at a given index.

    Returns a branch pointer from an internal node at a given index. There is always one more branch pointer than there are keys in an internal node so the highest index is equal to nodeLength( node ).

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  24. def getBranches(n: Node[K, V]): ArrayBuffer[Node[K, V]]

    Permalink

    Returns the branches of node as a non-strict immutable sequence.

    Returns the branches of node as a non-strict immutable sequence.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def getKey(n: Node[K, V], index: Int): K

    Permalink

    Returns a key from a leaf node at a given index.

    Returns a key from a leaf node at a given index.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  27. def getKeyValue(leaf: N, index: Int): (K, V)

    Permalink

    Returns the key/value pair at index within leaf.

    Returns the key/value pair at index within leaf.

    Attributes
    protected
    Definition Classes
    BPlusTree
  28. def getKeys(node: Node[K, V]): ArrayBuffer[K]

    Permalink

    Returns the keys of node as a non-strict immutable sequence.

    Returns the keys of node as a non-strict immutable sequence.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  29. def getNext(node: Node[K, V]): Node[K, V]

    Permalink

    Returns the next pointer of (leaf) node.

    Returns the next pointer of (leaf) node.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  30. def getParent(node: Node[K, V]): InternalNode[K, V]

    Permalink

    Returns the parent pointer of node.

    Returns the parent pointer of node.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  31. def getPrev(node: Node[K, V]): Node[K, V]

    Permalink

    Returns the previous leaf node link pointer of (leaf) node.

    Returns the previous leaf node link pointer of (leaf) node.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  32. def getValue(n: Node[K, V], index: Int): V

    Permalink

    Returns a value from a leaf node at a given index.

    Returns a value from a leaf node at a given index.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  33. def getValues(node: Node[K, V]): ArrayBuffer[V]

    Permalink

    Returns the values of node as a non-strict immutable sequence.

    Returns the values of node as a non-strict immutable sequence.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  34. def greatestLT(key: K): (N, Int)

    Permalink

    Returns the leaf position of the key that is greatest less than key.

    Returns the leaf position of the key that is greatest less than key.

    Attributes
    protected
    Definition Classes
    BPlusTree
  35. def greatestLTE(key: K): (N, Int)

    Permalink

    Returns the leaf position of the key that is greatest less than or equal to key.

    Returns the leaf position of the key that is greatest less than or equal to key.

    Attributes
    protected
    Definition Classes
    BPlusTree
  36. def greatestLessThan(key: K): Option[(K, V)]

    Permalink

    Returns the key/value pair whose key is greatest less than key.

    Returns the key/value pair whose key is greatest less than key.

    Definition Classes
    BPlusTree
  37. def greatestLessThanOrEqual(key: K): Option[(K, V)]

    Permalink

    Returns the key/value pair whose key is greatest less than or equal to key.

    Returns the key/value pair whose key is greatest less than or equal to key.

    Definition Classes
    BPlusTree
  38. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  39. def insert[V1 >: V](key: K, value: V1 = null.asInstanceOf[V1]): Boolean

    Permalink

    Inserts key with associated value into the tree.

    Inserts key with associated value into the tree. If key exists, then it's new associated value will be value.

    returns

    true if key exists

    Definition Classes
    BPlusTree
  40. def insertAt[V1 >: V](key: K, value: V1, leaf: N, index: Int): Unit

    Permalink

    Performs the B+ tree insertion algorithm to insert key and associated value into the tree, specifically in leaf at index, rebalancing the tree if necessary.

    Performs the B+ tree insertion algorithm to insert key and associated value into the tree, specifically in leaf at index, rebalancing the tree if necessary. If leaf and index is not the correct insertion point for key then this method will probably result in an invalid B+ tree.

    Attributes
    protected
    Definition Classes
    BPlusTree
  41. def insertIfNotFound[V1 >: V](key: K, value: V1 = null.asInstanceOf[V1]): Boolean

    Permalink

    Inserts key with associated value into the tree only if key does not exist.

    Inserts key with associated value into the tree only if key does not exist.

    returns

    true if key exists

    Definition Classes
    BPlusTree
  42. def insertInternal(n: Node[K, V], keyIndex: Int, key: K, branchIndex: Int, branch: Node[K, V]): Unit

    Permalink

    Inserts key and branch into (internal) node at keyIndex and branchIndex, respectively.

    Inserts key and branch into (internal) node at keyIndex and branchIndex, respectively.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  43. def insertKeys(keys: K*): Unit

    Permalink

    Inserts keys into the tree each with an associated value of null.

    Inserts keys into the tree each with an associated value of null. If a given key exists, then it's new associated value will be null.

    Definition Classes
    BPlusTree
  44. def insertKeysAndCheck(keys: K*): String

    Permalink

    Inserts keys into the tree each with an associated value of null, and checks that the tree is well constructed after each key is inserted.

    Inserts keys into the tree each with an associated value of null, and checks that the tree is well constructed after each key is inserted. If a given key exists, then it's new associated value will be null. This method is used for testing.

    Definition Classes
    BPlusTree
  45. def insertLeaf[V1 >: V](n: Node[K, V], index: Int, key: K, value: V1): Unit

    Permalink

    Inserts key and value into (leaf) node at index.

    Inserts key and value into (leaf) node at index.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  46. def isEmpty: Boolean

    Permalink

    Returns true is the tree is empty.

    Returns true is the tree is empty.

    Definition Classes
    BPlusTree
  47. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  48. def isLeaf(node: Node[K, V]): Boolean

    Permalink

    Returns true if node is a leaf node

    Returns true if node is a leaf node

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  49. def iterator: Iterator[(K, V)]

    Permalink

    Returns an iterator over all key/value pairs in the tree in ascending sorted key order.

    Returns an iterator over all key/value pairs in the tree in ascending sorted key order.

    Definition Classes
    BPlusTree
  50. def keys: Iterable[K]

    Permalink

    Returns a non-strict Iterable containing the keys in the tree.

    Returns a non-strict Iterable containing the keys in the tree.

    Definition Classes
    BPlusTree
  51. def keysIterator: Iterator[K]

    Permalink

    Returns an iterator over all keys in the tree in ascending sorted order.

    Returns an iterator over all keys in the tree in ascending sorted order.

    Definition Classes
    BPlusTree
  52. var last: Node[K, V]

    Permalink

    Last leaf node.

    Last leaf node. Implementations are required to set this as well as to create/update the in-storage copy of this if needed (only really applies to on-disk implementations). The methods in this class will take care of updating this variable, implementations only need to worry about the in-storage copy.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  53. var lastlen: Int

    Permalink

    Length of the last leaf node.

    Length of the last leaf node. This just speeds up bulk loading (the load method). Implementations are required to set this.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  54. def leastGT(key: K): (N, Int)

    Permalink

    Returns the leaf position of the key that is least greater than key.

    Returns the leaf position of the key that is least greater than key.

    Attributes
    protected
    Definition Classes
    BPlusTree
  55. def leastGTE(key: K): (N, Int)

    Permalink

    Returns the leaf position of the key that is least greater than or equal to key.

    Returns the leaf position of the key that is least greater than or equal to key.

    Attributes
    protected
    Definition Classes
    BPlusTree
  56. def leastGreaterThan(key: K): Option[(K, V)]

    Permalink

    Returns the key/value pair whose key is least greater than key.

    Returns the key/value pair whose key is least greater than key.

    Definition Classes
    BPlusTree
  57. def leastGreaterThanOrEqual(key: K): Option[(K, V)]

    Permalink

    Returns the key/value pair whose key is least greater than or equal to key.

    Returns the key/value pair whose key is least greater than or equal to key.

    Definition Classes
    BPlusTree
  58. def leftmost(node: N): K

    Permalink

    Returns the left most or least key within or under node.

    Returns the left most or least key within or under node.

    Attributes
    protected
    Definition Classes
    BPlusTree
  59. def load[V1 >: V](kvs: (K, V1)*): Unit

    Permalink

    Performs the B+ tree bulk loading algorithm to insert key/value pairs kvs into the tree efficiently.

    Performs the B+ tree bulk loading algorithm to insert key/value pairs kvs into the tree efficiently. This method is more efficient than using insert because insert performs a search to determine the correct insertion point for the key whereas load does not. load can only work if the tree is empty, or if the minimum key to be inserted is greater than the maximum key in the tree.

    Definition Classes
    BPlusTree
  60. def lookup(key: K): (Boolean, N, Int)

    Permalink

    Performs the B+ tree lookup algorithm (tail recursively) beginning at the root, in search of the location (if found) or correct insertion point (if not found) of key.

    Performs the B+ tree lookup algorithm (tail recursively) beginning at the root, in search of the location (if found) or correct insertion point (if not found) of key.

    returns

    a triple where the first element is true if key exists and false otherwise, the second element is the node containing key if found or the correct insertion point for key if not found, the third is the index within that node.

    Attributes
    protected
    Definition Classes
    BPlusTree
  61. def lookupGTE(key: K): (Boolean, N, Int)

    Permalink

    Searches for key returning a point in a leaf node that is the least greater than (if not found) or equal to (if found) key.

    Searches for key returning a point in a leaf node that is the least greater than (if not found) or equal to (if found) key. The leaf node and index returned in case key does not exist is not necessarily the correct insertion point. This method is used by boundedIterator.

    returns

    a triple where the first element is true if key exists and false otherwise, and the second element is the leaf node containing the least greater than or equal key, and the third is the index of that key.

    Attributes
    protected
    Definition Classes
    BPlusTree
  62. def lookupLTE(key: K): (Boolean, N, Int)

    Permalink

    Searches for key returning a point in a leaf node that is the greatest less than (if not found) or equal to (if found) key.

    Searches for key returning a point in a leaf node that is the greatest less than (if not found) or equal to (if found) key. The leaf node and index returned in case key does not exist is not necessarily the correct insertion point. This method is used by reverseBoundedIterator.

    returns

    a triple where the first element is true if key exists and false otherwise, and the second element is the leaf node containing the greatest less than or equal key, and the third is the index of that key.

    Attributes
    protected
    Definition Classes
    BPlusTree
  63. def max: Option[(K, V)]

    Permalink

    Returns the maximum key and it's associated value.

    Returns the maximum key and it's associated value.

    returns

    Some( (key, value) ) where key is the maximum key and value is it's associated value if the tree is non-empty, or None if the tree is empty.

    Definition Classes
    BPlusTree
  64. def maxKey: Option[K]

    Permalink

    Returns the maximum key.

    Returns the maximum key.

    Definition Classes
    BPlusTree
  65. def min: Option[(K, V)]

    Permalink

    Returns the minimum key and it's associated value.

    Returns the minimum key and it's associated value.

    returns

    Some( (key, value) ) where key is the minimum key and value is it's associated value if the tree is non-empty, or None if the tree is empty.

    Definition Classes
    BPlusTree
  66. def minKey: Option[K]

    Permalink

    Returns the minimum key.

    Returns the minimum key.

    Definition Classes
    BPlusTree
  67. val minlen: Int

    Permalink

    The minimum length (number of keys) that a non-root node (internal or leaf) may have is ceil(order/2) - 1.

    The minimum length (number of keys) that a non-root node (internal or leaf) may have is ceil(order/2) - 1. The minimum length for a root leaf node is 0. The minimum length for a root internal node is 1.

    Attributes
    protected
    Definition Classes
    BPlusTree
  68. def moveInternal(src: N, begin: Int, end: Int, dst: N, index: Int): Unit

    Permalink

    Moves key/branch pairs from node src beginning at index begin up to but not including index end to node dst at index.

    Moves key/branch pairs from node src beginning at index begin up to but not including index end to node dst at index.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  69. def moveLeaf(src: Node[K, V], begin: Int, end: Int, dst: Node[K, V], index: Int): Unit

    Permalink

    Moves key/value pairs from node src to node dst beginning at index begin and ending up to but not including index end.

    Moves key/value pairs from node src to node dst beginning at index begin and ending up to but not including index end.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  70. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  71. def newInternal(parent: Node[K, V]): InternalNode[K, V]

    Permalink

    Creates a new internal node with parent as its parent pointer.

    Creates a new internal node with parent as its parent pointer.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  72. def newLeaf(parent: Node[K, V]): LeafNode[K, V]

    Permalink

    Creates a new leaf node with parent as its parent pointer.

    Creates a new leaf node with parent as its parent pointer.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  73. def newRoot(branch: Node[K, V]): InternalNode[K, V]

    Permalink

    Creates a new root (internal) node with branch as its leftmost branch pointer and null parent pointer.

    Creates a new root (internal) node with branch as its leftmost branch pointer and null parent pointer. Implementations are require to update the in-storage copy of the root pointer if needed (only really applies to on-disk implementations).

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  74. def nextPosition(leaf: N, index: Int): (N, Int)

    Permalink

    Returns the node/index pair pointing to the location of the leaf node key following the one at index in leaf.

    Returns the node/index pair pointing to the location of the leaf node key following the one at index in leaf.

    Attributes
    protected
    Definition Classes
    BPlusTree
  75. def nodeLength(node: Node[K, V]): Int

    Permalink

    Returns the length (number of keys) of node.

    Returns the length (number of keys) of node. For internal nodes, the number of branch pointers will one more than the length.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  76. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  77. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  78. def nul: Null

    Permalink

    Returns the null node pointer.

    Returns the null node pointer. For in-memory implementations this will usually be a Scala null value. For on-disk it would make sense for this to be 0L.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  79. def optionalKey(pos: (N, Int)): Option[K]

    Permalink
    Attributes
    protected
    Definition Classes
    BPlusTree
  80. def optionalKeyValue(pos: (N, Int)): Option[(K, V)]

    Permalink
    Attributes
    protected
    Definition Classes
    BPlusTree
  81. val order: Int

    Permalink

    the branching factor (maximum number of branches in an internal node) of the tree

    the branching factor (maximum number of branches in an internal node) of the tree

    Definition Classes
    MemoryBPlusTreeBPlusTree
  82. def positionIterator: Iterator[(N, Int)]

    Permalink

    Returns an iterator over all key positions (node/index pairs) in the tree in ascending sorted key order.

    Returns an iterator over all key positions (node/index pairs) in the tree in ascending sorted key order.

    Attributes
    protected
    Definition Classes
    BPlusTree
  83. def prettyPrint: Unit

    Permalink

    Prints (to stdout) a readable representation of the structure and contents of the tree.

    Prints (to stdout) a readable representation of the structure and contents of the tree.

    Definition Classes
    BPlusTree
  84. def prettyPrintKeysOnly: Unit

    Permalink

    Prints (to stdout) a readable representation of the structure and contents of the tree, omitting the values and only printing the keys.

    Prints (to stdout) a readable representation of the structure and contents of the tree, omitting the values and only printing the keys.

    Definition Classes
    BPlusTree
  85. def prettySearch(key: K): String

    Permalink

    Returns a string representing a search result for key that will be consistant with prettyPrint.

    Returns a string representing a search result for key that will be consistant with prettyPrint. This method is used mainly for unit testing.

    Definition Classes
    BPlusTree
  86. def prettyString: String

    Permalink

    Returns a string containing a readable representation of the structure and contents of the tree, omitting the values and only printing the keys.

    Returns a string containing a readable representation of the structure and contents of the tree, omitting the values and only printing the keys. This method is used mainly for unit testing.

    Definition Classes
    BPlusTree
  87. def prettyStringWithValues: String

    Permalink

    Returns a string containing a readable representation of the structure and contents of the tree.

    Returns a string containing a readable representation of the structure and contents of the tree. This method is used mainly for unit testing.

    Definition Classes
    BPlusTree
  88. def prevPosition(leaf: N, index: Int): (N, Int)

    Permalink

    Returns the node/index pair pointing to the location of the leaf node key preceding the one at index in leaf.

    Returns the node/index pair pointing to the location of the leaf node key preceding the one at index in leaf.

    Attributes
    protected
    Definition Classes
    BPlusTree
  89. def removeInternal(node: Node[K, V], keyIndex: Int, branchIndex: Int): Int

    Permalink

    Removes the key and branch pair from internal node at keyIndex and branchIndex, respectively.

    Removes the key and branch pair from internal node at keyIndex and branchIndex, respectively. This method is perhaps poorly named: it does not remove an internal node from the tree.

    returns

    length of node after removal

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  90. def removeLeaf(node: Node[K, V], index: Int): Int

    Permalink

    Removes the key/value pair from leaf node at index.

    Removes the key/value pair from leaf node at index. This method is perhaps poorly named: it does not remove a leaf node from the tree.

    returns

    length of node after removal

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  91. def reverseBoundedIterator(bounds: (Symbol, K)*): Iterator[(K, V)]

    Permalink

    Returns a bounded iterator over a range of key/value pairs in the tree in descending sorted key order.

    Returns a bounded iterator over a range of key/value pairs in the tree in descending sorted key order. The range of key/value pairs in the iterator is specified by bounds. bounds must contain one or two pairs where the first element in the pair is a symbol corresponding to the type of bound (i.e. '<, '<=, '>, '>=) and the second element is a key value.

    An example of a reverse bounded iterator over all elements in a tree (with String keys) that will include all keys that sort greater than or equal to "a" and up to but not including "e", iterated over in reverse order, is reverseBoundedIterator( ('>=, "a"), ('<, "e") ).

    Definition Classes
    BPlusTree
  92. def reverseBoundedKeysIterator(bounds: (Symbol, K)*): Iterator[K]

    Permalink

    Returns a bounded iterator over a range of keys in the tree in descending sorted key order.

    Returns a bounded iterator over a range of keys in the tree in descending sorted key order. The bounds parameter is the same as for boundedIterator.

    Definition Classes
    BPlusTree
  93. def reverseBoundedPositionIterator(bounds: (Symbol, K)*): Iterator[(N, Int)]

    Permalink

    Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in descending sorted key order.

    Returns a bounded iterator over a range of key positions (node/index pairs) in the tree in descending sorted key order. The bounds parameter is the same as for boundedIterator.

    Attributes
    protected
    Definition Classes
    BPlusTree
  94. def reverseBoundedValuesIterator(bounds: (Symbol, K)*): Iterator[V]

    Permalink

    Returns a bounded iterator over a range of values in the tree in descending sorted key order.

    Returns a bounded iterator over a range of values in the tree in descending sorted key order. The bounds parameter is the same as for boundedIterator.

    Definition Classes
    BPlusTree
  95. def reverseIterator: Iterator[(K, V)]

    Permalink

    Returns an iterator over all key/value pairs in the tree in descending sorted key order.

    Returns an iterator over all key/value pairs in the tree in descending sorted key order.

    Definition Classes
    BPlusTree
  96. def reverseKeysIterator: Iterator[K]

    Permalink

    Returns a reverse iterator over all keys in the tree in descending sorted order.

    Returns a reverse iterator over all keys in the tree in descending sorted order.

    Definition Classes
    BPlusTree
  97. def reversePositionIterator: Iterator[(N, Int)]

    Permalink

    Returns a reverse iterator over all key positions (node/index pairs) in the tree in descending sorted key order.

    Returns a reverse iterator over all key positions (node/index pairs) in the tree in descending sorted key order.

    Attributes
    protected
    Definition Classes
    BPlusTree
  98. def rightmost(node: N): K

    Permalink

    Returns the right most or greatest key within or under node.

    Returns the right most or greatest key within or under node.

    Attributes
    protected
    Definition Classes
    BPlusTree
  99. var root: Node[K, V]

    Permalink

    Root node.

    Root node. Implementations are required to set this as well as to create/update the in-storage copy of this if needed (only really applies to on-disk implementations). The methods in this class will take care of updating this variable, implementations only need to worry about the in-storage copy.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  100. def search(key: K): Option[V]

    Permalink

    Searches for key returning it's associated value if key exists.

    Searches for key returning it's associated value if key exists.

    returns

    Some( value ) where value is the value associated to key if it exists, or None otherwise

    Definition Classes
    BPlusTree
  101. def serialize(before: String, prefix: String, internalnode: (N, (N) ⇒ String, (String) ⇒ Unit) ⇒ String, leafnode: (N, (N) ⇒ String) ⇒ String, after: String): String

    Permalink

    Returns a serialization (string representation of the tree) using string and function arguments to specify the exact form of the serialization.

    Returns a serialization (string representation of the tree) using string and function arguments to specify the exact form of the serialization. This method is used for pretty printing and to generate a DOT (graph description language) description of the tree so that it can be visualized.

    before

    string to be prepended to the serialization

    prefix

    string to be place before each line of the serialization that includes internal and leaf nodes

    internalnode

    function to generate internal node serializations using three parameters: the current node, a function to return a string id of a node, a function that allows a line of text to be appended after all nodes have been serialized

    leafnode

    function to generate leaf node serializations using two parameters: the current node, a function to return a string id of a node

    after

    string to be appended to the serialization

    Attributes
    protected
    Definition Classes
    BPlusTree
  102. def setFirst(leaf: Node[K, V]): Unit

    Permalink

    Sets the in-storage copy of the first leaf node pointer.

    Sets the in-storage copy of the first leaf node pointer. This method is not responsable for setting the first variable.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  103. def setKey(node: Node[K, V], index: Int, key: K): Unit

    Permalink

    Sets the key at index of node to key.

    Sets the key at index of node to key.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  104. def setLast(leaf: Node[K, V]): Unit

    Permalink

    Sets the in-storage copy of the last leaf node pointer.

    Sets the in-storage copy of the last leaf node pointer. This method is not responsable for setting the last variable nor the lastlen variable.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  105. def setNext(node: Node[K, V], p: Node[K, V]): Unit

    Permalink

    Sets the next pointer of (leaf) node to p.

    Sets the next pointer of (leaf) node to p.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  106. def setParent(node: Node[K, V], p: Node[K, V]): Unit

    Permalink

    Sets the parent pointer of node to p.

    Sets the parent pointer of node to p.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  107. def setPrev(node: Node[K, V], p: Node[K, V]): Unit

    Permalink

    Sets previous leaf node link pointer of (leaf) node to p.

    Sets previous leaf node link pointer of (leaf) node to p.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  108. def setRoot(node: Node[K, V]): Unit

    Permalink

    Sets the in-storage copy of the root node pointer.

    Sets the in-storage copy of the root node pointer. This method is not responsable for setting the root variable.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  109. def setValue[V1 >: V](node: Node[K, V], index: Int, v: V1): Unit

    Permalink

    Sets the value at index of node to v.

    Sets the value at index of node to v.

    Attributes
    protected
    Definition Classes
    MemoryBPlusTreeBPlusTree
  110. def str(node: N): String

    Permalink

    Returns a string representation of the keys in node.

    Returns a string representation of the keys in node. This method was used in debugging FileBPlusTree since the node type is Long.

    Attributes
    protected
    Definition Classes
    BPlusTree
  111. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  112. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  113. def traverseBreadthFirst(level: (List[N]) ⇒ Unit): Unit

    Permalink

    Performs a breadth first traversal of the tree (tail recursively), applying level to each level of the tree beginning at the root.

    Performs a breadth first traversal of the tree (tail recursively), applying level to each level of the tree beginning at the root.

    Attributes
    protected
    Definition Classes
    BPlusTree
  114. def valuesIterator: Iterator[V]

    Permalink

    Returns an iterator over all values in the tree in the order corresponding to ascending keys.

    Returns an iterator over all values in the tree in the order corresponding to ascending keys.

    Definition Classes
    BPlusTree
  115. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  116. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  117. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  118. def wellConstructed: String

    Permalink

    Analyzes the tree to determine if it is well constructed.

    Analyzes the tree to determine if it is well constructed.

    returns

    "true" (as a string) if the tree is a well constructed B+ tree, a string description of the flaw otherwise.

    Definition Classes
    BPlusTree

Inherited from BPlusTree[K, V]

Inherited from AnyRef

Inherited from Any

Ungrouped