Class AVLNodeStore

java.lang.Object
com.semedy.reasoner.edb.ramstore.AVLNodeStore

public class AVLNodeStore extends Object
An avl tree
Author:
Juergen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int[]
    the avl nodes
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    bal(int n)
    get the balance value
    void
    clear the avl tree
    int
    data(int n)
    get the index for the data
    int[]
    retrun all nodes
    int
    left(int n)
    get the left node
    int
    create a new node
    void
    removeNode(int address)
    remove node
    int
    right(int n)
    get the right node
    void
    setBal(int n, int b)
    set the balance value for node n
    void
    setData(int n, int d)
    set the data index for node n
    void
    setLeft(int n, int l)
    set the left node for node n
    void
    setRight(int n, int r)
    set the right node for node n
    int
    return the number of nodes
    int
    return the number of bytes used in main memory

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _elementData

      public int[] _elementData
      the avl nodes
  • Constructor Details

  • Method Details

    • sizeInBytes

      public int sizeInBytes()
      return the number of bytes used in main memory
      Returns:
    • newNode

      public int newNode() throws IOException
      create a new node
      Returns:
      Throws:
      IOException
    • getElementData

      public int[] getElementData()
      retrun all nodes
      Returns:
    • right

      public int right(int n)
      get the right node
      Parameters:
      n -
      Returns:
    • left

      public int left(int n)
      get the left node
      Parameters:
      n -
      Returns:
    • bal

      public int bal(int n)
      get the balance value
      Parameters:
      n -
      Returns:
    • data

      public int data(int n)
      get the index for the data
      Parameters:
      n -
      Returns:
    • setRight

      public void setRight(int n, int r)
      set the right node for node n
      Parameters:
      n -
      r -
    • setLeft

      public void setLeft(int n, int l)
      set the left node for node n
      Parameters:
      n -
      l -
    • setBal

      public void setBal(int n, int b)
      set the balance value for node n
      Parameters:
      n -
      b -
    • setData

      public void setData(int n, int d)
      set the data index for node n
      Parameters:
      n -
      d -
    • removeNode

      public void removeNode(int address)
      remove node
      Parameters:
      address -
    • size

      public int size()
      return the number of nodes
      Returns:
    • clear

      public void clear()
      clear the avl tree