Packages

class Node[K] extends Error

The Node class defines a splittable node type with methods for finding entries (keys and values).

Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Node
  2. Error
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Node(lt: Node[K], kd: K, rt: Node[K], half: Int)(implicit arg0: (K) ⇒ Ordered[K], arg1: ClassTag[K])

    Construct a new root node with one key (and two references) in it.

    Construct a new root node with one key (and two references) in it.

    lt

    the left node

    kd

    the divider key

    rt

    the right node

  2. new Node(isLeaf: Boolean = true, half: Int = 2)(implicit arg0: (K) ⇒ Ordered[K], arg1: ClassTag[K])

    isLeaf

    whether the node is a leaf (true) or internal node (false)

    half

    half the maximum number of keys allowed in a ndoe

Value Members

  1. def find(k: K): Int

    Find the "<=" position of key 'k' in 'this' node.

    Find the "<=" position of key 'k' in 'this' node. If 'k' is larger than all keys in 'this' node, return 'nkeys'.

    k

    the key whose position is sought

  2. final def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  3. val half: Int
  4. def isFull: Boolean

    Determine whether 'this' mode is currently full.

  5. val isLeaf: Boolean
  6. val key: Array[K]

    The array of keys

  7. val mx: Int

    The maximum number of keys

  8. var nKeys: Int

    The number of active keys

  9. val ref: Array[Any]

    The array of references

  10. def split(): (K, Node[K])

    Split 'this' node by creating a right sibling 'rt' and moving half the keys and references to that new node.

    Split 'this' node by creating a right sibling 'rt' and moving half the keys and references to that new node. Return the divider key and the right sibling node.

  11. def toString(): String

    Convert 'this' node to a string.

    Convert 'this' node to a string.

    Definition Classes
    Node → AnyRef → Any
  12. def wedge(k: K, v: Any, ip: Int, left: Boolean = true): Unit

    When space is available, wedge the new key 'k' and value 'v' into 'this' node at the given insertion position 'ip'.

    When space is available, wedge the new key 'k' and value 'v' into 'this' node at the given insertion position 'ip'.

    k

    the new key

    v

    the new value

    ip

    the insertion position

    left

    whether to start with from the left size of the key