core-avl/src/main/java/org/apache/directory/server/core/avltree/LinkedAvlMapNode.java [150:204]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.previous = previous;
    }


    public int computeHeight()
    {

        if ( right == null && left == null )
        {
            height = 1;
            return height;
        }

        int lh, rh;

        if ( isLeft )
        {
            lh = ( left == null ? -1 : left.computeHeight() );
            rh = ( right == null ? -1 : right.getHeight() );
        }
        else
        {
            rh = ( right == null ? -1 : right.computeHeight() );
            lh = ( left == null ? -1 : left.getHeight() );
        }

        height = 1 + Math.max( lh, rh );

        return height;
    }


    public int getBalance()
    {
        int lh = ( left == null ? 0 : left.computeHeight() );
        int rh = ( right == null ? 0 : right.computeHeight() );

        return ( rh - lh );
    }


    public int getIndex()
    {
        return index;
    }


    public void setIndex( int index )
    {
        this.index = index;
    }


    @Override
    public String toString()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



core-avl/src/main/java/org/apache/directory/server/core/avltree/LinkedAvlNode.java [139:193]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.previous = previous;
    }


    public int computeHeight()
    {

        if ( right == null && left == null )
        {
            height = 1;
            return height;
        }

        int lh, rh;

        if ( isLeft )
        {
            lh = ( left == null ? -1 : left.computeHeight() );
            rh = ( right == null ? -1 : right.getHeight() );
        }
        else
        {
            rh = ( right == null ? -1 : right.computeHeight() );
            lh = ( left == null ? -1 : left.getHeight() );
        }

        height = 1 + Math.max( lh, rh );

        return height;
    }


    public int getBalance()
    {
        int lh = ( left == null ? 0 : left.computeHeight() );
        int rh = ( right == null ? 0 : right.computeHeight() );

        return ( rh - lh );
    }


    public int getIndex()
    {
        return index;
    }


    public void setIndex( int index )
    {
        this.index = index;
    }


    @Override
    public String toString()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



