当前位置: 首页>>代码示例>>Java>>正文


Java NodeAVL类代码示例

本文整理汇总了Java中org.hsqldb.index.NodeAVL的典型用法代码示例。如果您正苦于以下问题:Java NodeAVL类的具体用法?Java NodeAVL怎么用?Java NodeAVL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NodeAVL类属于org.hsqldb.index包,在下文中一共展示了NodeAVL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: delete

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 * Row might have changed from memory to disk or indexes added
 */
public void delete(Session session, Row row) {

    NodeAVL node  = ((RowAVL) row).getNode(0);
    int     count = 0;

    while (node != null) {
        count++;

        node = node.nNext;
    }

    if ((isCached ^ !row.isMemory()) || count != indexList.length) {
        row = ((Table) table).getDeleteRowFromLog(session, row.getData());
    }

    if (row != null) {
        super.delete(session, row);
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:23,代码来源:RowStoreAVLHybridExtended.java

示例2: dropIndexFromRows

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
void dropIndexFromRows(Index primaryIndex, Index oldIndex) {

        RowIterator it       = primaryIndex.firstRow(this);
        int         position = oldIndex.getPosition() - 1;

        while (it.hasNext()) {
            Row     row      = it.getNextRow();
            int     i        = position - 1;
            NodeAVL backnode = ((RowAVL) row).getNode(0);

            while (i-- > 0) {
                backnode = backnode.nNext;
            }

            backnode.nNext = backnode.nNext.nNext;
        }

        it.release();
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:20,代码来源:RowStoreAVL.java

示例3: dropIndexFromRows

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
void dropIndexFromRows(Index primaryIndex,
                       Index oldIndex) {

    RowIterator it       = primaryIndex.firstRow(this);
    int         position = oldIndex.getPosition() - 1;

    while (it.hasNext()) {
        Row     row      = it.getNextRow();
        int     i        = position - 1;
        NodeAVL backnode = ((RowAVL) row).getNode(0);

        while (i-- > 0) {
            backnode = backnode.nNext;
        }

        backnode.nNext = backnode.nNext.nNext;
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:19,代码来源:RowStoreAVLMemory.java

示例4: getAccessor

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
public CachedObject getAccessor(Index key) {

        NodeAVL node = (NodeAVL) accessorList[key.getPosition()];

        if (node == null) {
            return null;
        }

        if (!node.isInMemory()) {
            RowAVL row = (RowAVL) get(node.getPos(), false);

            node                            = row.getNode(key.getPosition());
            accessorList[key.getPosition()] = node;
        }

        return node;
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:18,代码来源:RowStoreAVLDisk.java

示例5: RowAVL

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 *  Constructor for MEMORY table Row. The result is a Row with Nodes that
 *  are not yet linked with other Nodes in the AVL indexes.
 */
public RowAVL(TableBase t, Object[] o) {

    int index = t.getIndexCount();

    nPrimaryNode = new NodeAVLMemory(this);

    NodeAVL n = nPrimaryNode;

    for (int i = 1; i < index; i++) {
        n.nNext = new NodeAVLMemory(this);
        n       = n.nNext;
    }

    tableId = t.getId();
    rowData = o;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:RowAVL.java

示例6: RowAVLDisk

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 *  Constructor when read from the disk into the Cache.
 *
 * @param t table
 * @param in data source
 * @throws IOException
 */
public RowAVLDisk(TableBase t,
                  RowInputInterface in) throws IOException {

    tTable      = t;
    position    = in.getPos();
    storageSize = in.getSize();

    int indexcount = t.getIndexCount();

    nPrimaryNode = new NodeAVLDisk(this, in, 0);

    NodeAVL n = nPrimaryNode;

    for (int i = 1; i < indexcount; i++) {
        n.nNext = new NodeAVLDisk(this, in, i);
        n       = n.nNext;
    }

    rowData = in.readData(tTable.getColumnTypes());
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:28,代码来源:RowAVLDisk.java

示例7: delete

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 * Row might have changed from memory to disk or indexes added
 */
public void delete(Session session, Row row) {

    NodeAVL node  = ((RowAVL) row).getNode(0);
    int     count = 0;

    while (node != null) {
        count++;

        node = node.nNext;
    }

    if ((isCached && row.isMemory()) || count != indexList.length) {
        row = ((Table) table).getDeleteRowFromLog(session, row.getData());
    }

    if (row != null) {
        super.delete(session, row);
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:23,代码来源:RowStoreAVLHybridExtended.java

示例8: indexRow

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
public void indexRow(Session session, Row row) {

        NodeAVL node  = ((RowAVL) row).getNode(0);
        int     count = 0;

        while (node != null) {
            count++;

            node = node.nNext;
        }

        if (count != indexList.length) {
            resetAccessorKeys(table.getIndexList());
            ((RowAVL) row).setNewNodes(this);
        }

        super.indexRow(session, row);
    }
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:19,代码来源:RowStoreAVLHybridExtended.java

示例9: dropIndexFromRows

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
void dropIndexFromRows(Index primaryIndex, Index oldIndex) {

        RowIterator it       = primaryIndex.firstRow(this);
        int         position = oldIndex.getPosition() - 1;

        while (it.hasNext()) {
            Row     row      = it.getNextRow();
            int     i        = position - 1;
            NodeAVL backnode = ((RowAVL) row).getNode(0);

            while (i-- > 0) {
                backnode = backnode.nNext;
            }

            backnode.nNext = backnode.nNext.nNext;
        }
    }
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:18,代码来源:RowStoreAVL.java

示例10: changeToDiskTable

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
public final void changeToDiskTable(Session session) {

        cache =
            session.sessionData.persistentStoreCollection
                .getSessionDataCache();
        maxMemoryRowCount = Integer.MAX_VALUE;

        if (cache == null) {
            return;
        }

        tableSpace =
            cache.spaceManager.getTableSpace(DataSpaceManager.tableIdDefault);
        isCached = true;

        cache.adjustStoreCount(1);

        if (elementCount.get() == 0) {
            return;
        }

        IndexAVL    idx      = (IndexAVL) indexList[0];
        NodeAVL     root     = (NodeAVL) accessorList[0];
        RowIterator iterator = table.rowIterator(this);

        ArrayUtil.fillArray(accessorList, null);
        ArrayUtil.fillArray(nullsList, false);
        elementCount.set(0);

        while (iterator.hasNext()) {
            Row row = iterator.getNextRow();
            Row newRow = (Row) getNewCachedObject(session, row.getData(),
                                                  false);

            indexRow(session, newRow);
        }

        idx.unlinkNodes(root);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:40,代码来源:RowStoreAVLHybrid.java

示例11: destroy

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 * Used with memory indexes
 */
void destroy() {

    if (indexList.length == 0) {
        return;
    }

    IndexAVL idx  = (IndexAVL) indexList[0];
    NodeAVL  root = (NodeAVL) accessorList[0];

    idx.unlinkNodes(root);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:15,代码来源:RowStoreAVL.java

示例12: setNewNodes

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 *  Used when data is read from the disk into the Cache the first time.
 *  New Nodes are created which are then indexed.
 */
public void setNewNodes(PersistentStore store) {

    int index = store.getAccessorKeys().length;

    nPrimaryNode = new NodeAVL(this);

    NodeAVL n = nPrimaryNode;

    for (int i = 1; i < index; i++) {
        n.nNext = new NodeAVL(this);
        n       = n.nNext;
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:18,代码来源:RowAVLDiskData.java

示例13: getNode

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 * Returns the Node for a given Index, using the ordinal position of the
 * Index within the Table Object.
 */
public NodeAVL getNode(int index) {

    NodeAVL n = nPrimaryNode;

    while (index-- > 0) {
        n = n.nNext;
    }

    return n;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:15,代码来源:RowAVL.java

示例14: getNextNode

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 *  Returns the Node for the next Index on this database row, given the
 *  Node for any Index.
 */
NodeAVL getNextNode(NodeAVL n) {

    if (n == null) {
        n = nPrimaryNode;
    } else {
        n = n.nNext;
    }

    return n;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:15,代码来源:RowAVL.java

示例15: setNewNodes

import org.hsqldb.index.NodeAVL; //导入依赖的package包/类
/**
 *  Used when data is read from the disk into the Cache the first time.
 *  New Nodes are created which are then indexed.
 */
void setNewNodes() {

    int index = tTable.getIndexCount();

    nPrimaryNode = new NodeAVLMemoryPointer(this);

    NodeAVL n = nPrimaryNode;

    for (int i = 1; i < index; i++) {
        n.nNext = new NodeAVLMemoryPointer(this);
        n       = n.nNext;
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:18,代码来源:RowAVLDiskData.java


注:本文中的org.hsqldb.index.NodeAVL类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。