Documentation of 'org.neodatis.btree.impl.AbstractBTreeNode' Java class
AbstractBTreeNode
org.neodatis.btree.impl

Class AbstractBTreeNode

    • Constructor Detail

      • AbstractBTreeNode

        public AbstractBTreeNode()
      • AbstractBTreeNode

        public AbstractBTreeNode(IBTree btree)
    • Method Detail

      • insertKeyAndValue

        public abstract void insertKeyAndValue(java.lang.Comparable key,
                                               java.lang.Object value)
        Specified by:
        insertKeyAndValue in interface IBTreeNode
      • getChildAt

        public abstract IBTreeNode getChildAt(int index,
                                              boolean throwExceptionIfNotExist)
        Specified by:
        getChildAt in interface IBTreeNode
      • getParentId

        public abstract java.lang.Object getParentId()
        Specified by:
        getParentId in interface IBTreeNode
      • hasParent

        public abstract boolean hasParent()
        Specified by:
        hasParent in interface IBTreeNode
      • moveChildFromTo

        public abstract void moveChildFromTo(int sourceIndex,
                                             int destinationIndex,
                                             boolean throwExceptionIfDoesNotExist)
        Specified by:
        moveChildFromTo in interface IBTreeNode
      • extractRightPart

        public IBTreeNode extractRightPart()
        Creates a new node with the right part of this node. This should only be called on a full node
        Specified by:
        extractRightPart in interface IBTreeNode
      • getKeyAt

        public java.lang.Comparable getKeyAt(int index)
        Specified by:
        getKeyAt in interface IBTreeNode
      • getPositionOfKey

        public int getPositionOfKey(java.lang.Comparable key)
        Returns the position of the key. If the key does not exist in node, returns the position where this key should be,multiplied by -1
         for example for node of degree 3 : [1 89 452 789 - ],
          calling getPositionOfKey(89) returns 2 (starts with 1)
          calling getPositionOfKey(99) returns -2 (starts with 1),because the position should be done, but it does not exist so multiply by -1
         this is used to know the child we should descend to!in this case the getChild(2). 
         
         
        Specified by:
        getPositionOfKey in interface IBTreeNode
        Parameters:
        key -
        Returns:
        The position of the key,as a negative number if key does not exist, warning, the position starts with 1and not 0!
      • setKeyAndValueAt

        public void setKeyAndValueAt(java.lang.Comparable key,
                                     java.lang.Object value,
                                     int index)
        Specified by:
        setKeyAndValueAt in interface IBTreeNode
      • setKeyAndValueAt

        public void setKeyAndValueAt(java.lang.Comparable key,
                                     java.lang.Object value,
                                     int index,
                                     boolean shiftIfAlreadyExist,
                                     boolean incrementNbKeys)
        Specified by:
        setKeyAndValueAt in interface IBTreeNode
      • setKeyAndValueAt

        public void setKeyAndValueAt(IKeyAndValue keyAndValue,
                                     int index,
                                     boolean shiftIfAlreadyExist,
                                     boolean incrementNbKeys)
        Specified by:
        setKeyAndValueAt in interface IBTreeNode
      • isFull

        public boolean isFull()
        Specified by:
        isFull in interface IBTreeNode
      • isLeaf

        public boolean isLeaf()
        Specified by:
        isLeaf in interface IBTreeNode
      • mergeWith

        public void mergeWith(IBTreeNode node)
        Can only merge node without intersection => the greater key of this must be smaller than the smallest key of the node
        Specified by:
        mergeWith in interface IBTreeNode
      • setNbKeys

        public void setNbKeys(int nbKeys)
        Specified by:
        setNbKeys in interface IBTreeNode
      • deleteKeyAndValueAt

        public java.lang.Object deleteKeyAndValueAt(int keyIndex,
                                                    boolean shiftChildren)
        Specified by:
        deleteKeyAndValueAt in interface IBTreeNode
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clear

        public void clear()
        Specified by:
        clear in interface IBTreeNode

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.