Package org.hsqldb

Examples of org.hsqldb.RowAVLDisk


    }

    NodeAVL getParent(PersistentStore store) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.isInMemory()) {
            row  = (RowAVLDisk) store.get(this.row, false);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (node.iParent == NO_POS) {
            return null;
        }
View Full Code Here


    }

    public int getBalance(PersistentStore store) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.isInMemory()) {
            row  = (RowAVLDisk) store.get(this.row, false);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        return node.iBalance;
    }
View Full Code Here

    }

    boolean isRoot(PersistentStore store) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.isInMemory()) {
            row  = (RowAVLDisk) store.get(this.row, false);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        return node.iParent == NO_POS;
    }
View Full Code Here

    }

    boolean isFromLeft(PersistentStore store) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.isInMemory()) {
            row  = (RowAVLDisk) store.get(this.row, false);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (node.iParent == NO_POS) {
            return true;
        }

        if (node.nParent == null || !node.nParent.isInMemory()) {
            node.nParent = findNode(store, iParent);
        }

        return row.getPos() == ((NodeAVLDiskLarge) node.nParent).iLeft;
    }
View Full Code Here

    }

    NodeAVL setParent(PersistentStore store, NodeAVL n) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.keepInMemory(true)) {
            row  = (RowAVLDisk) store.get(this.row, true);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (!row.isInMemory()) {
            row.keepInMemory(false);

            throw Error.runtimeError(ErrorCode.U_S0500, "NodeAVLDisk");
        }

        row.setNodesChanged();

        node.iParent = n == null ? NO_POS
                                 : n.getPos();

        if (n != null && !n.isInMemory()) {
            n = findNode(store, n.getPos());
        }

        node.nParent = (NodeAVLDiskLarge) n;

        row.keepInMemory(false);

        return node;
    }
View Full Code Here

    }

    public NodeAVL setBalance(PersistentStore store, int b) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.keepInMemory(true)) {
            row  = (RowAVLDisk) store.get(this.row, true);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (!row.isInMemory()) {
            throw Error.runtimeError(ErrorCode.U_S0500, "NodeAVLDisk");
        }

        row.setNodesChanged();

        node.iBalance = b;

        row.keepInMemory(false);

        return node;
    }
View Full Code Here

    }

    NodeAVL setLeft(PersistentStore store, NodeAVL n) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.keepInMemory(true)) {
            row  = (RowAVLDisk) store.get(this.row, true);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (!row.isInMemory()) {
            throw Error.runtimeError(ErrorCode.U_S0500, "NodeAVLDisk");
        }

        row.setNodesChanged();

        node.iLeft = n == null ? NO_POS
                               : n.getPos();

        if (n != null && !n.isInMemory()) {
            n = findNode(store, n.getPos());
        }

        node.nLeft = (NodeAVLDiskLarge) n;

        row.keepInMemory(false);

        return node;
    }
View Full Code Here

    }

    NodeAVL setRight(PersistentStore store, NodeAVL n) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.keepInMemory(true)) {
            row  = (RowAVLDisk) store.get(this.row, true);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (!row.isInMemory()) {
            throw Error.runtimeError(ErrorCode.U_S0500, "NodeAVLDisk");
        }

        row.setNodesChanged();

        node.iRight = n == null ? NO_POS
                                : n.getPos();

        if (n != null && !n.isInMemory()) {
            n = findNode(store, n.getPos());
        }

        node.nRight = (NodeAVLDiskLarge) n;

        row.keepInMemory(false);

        return node;
    }
View Full Code Here

    }

    public void replace(PersistentStore store, Index index, NodeAVL n) {

        NodeAVLDiskLarge node = this;
        RowAVLDisk  row  = this.row;

        if (!row.keepInMemory(true)) {
            row  = (RowAVLDisk) store.get(this.row, true);
            node = (NodeAVLDiskLarge) row.getNode(iId);
        }

        if (node.iParent == NO_POS) {
            if (n != null) {
                n = n.setParent(store, null);
            }

            store.setAccessor(index, n);
        } else {
            boolean isFromLeft = node.isFromLeft(store);

            node.getParent(store).set(store, isFromLeft, n);
        }

        row.keepInMemory(false);
    }
View Full Code Here

    }

    private NodeAVLDisk findNode(PersistentStore store, int pos) {

        NodeAVLDisk ret = null;
        RowAVLDisk  r   = (RowAVLDisk) store.get(pos, false);

        if (r != null) {
            ret = (NodeAVLDisk) r.getNode(iId);
        }

        return ret;
    }
View Full Code Here

TOP

Related Classes of org.hsqldb.RowAVLDisk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.