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


Java RowAVL类代码示例

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


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

示例1: rollbackRow

import org.hsqldb.RowAVL; //导入依赖的package包/类
public void rollbackRow(Session session, Row row, int changeAction,
                        int txModel) {

    switch (changeAction) {

        case RowAction.ACTION_DELETE :
            if (txModel == TransactionManager.LOCKS) {
                ((RowAVL) row).setNewNodes(this);
                indexRow(session, row);
            }
            break;

        case RowAction.ACTION_INSERT :
            delete(session, row);
            remove(row);
            break;

        case RowAction.ACTION_INSERT_DELETE :

            // INSERT + DELETE
            remove(row);
            break;
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:25,代码来源:RowStoreAVLMemory.java

示例2: delete

import org.hsqldb.RowAVL; //导入依赖的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

示例3: indexRows

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

        writeLock();

        try {
            for (int i = 1; i < indexList.length; i++) {
                setAccessor(indexList[i], null);
            }

            RowIterator it = rowIterator();

            while (it.hasNext()) {
                Row row = it.getNextRow();

                ((RowAVL) row).clearNonPrimaryNodes();

                for (int i = 1; i < indexList.length; i++) {
                    indexList[i].insert(session, this, row);
                }
            }
        } finally {
            writeUnlock();
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:25,代码来源:RowStoreAVL.java

示例4: reindex

import org.hsqldb.RowAVL; //导入依赖的package包/类
public void reindex(Session session, Index index) {

        writeLock();

        try {
            setAccessor(index, null);

            RowIterator it = table.rowIterator(this);

            while (it.hasNext()) {
                RowAVL row = (RowAVL) it.getNextRow();

                row.getNode(index.getPosition()).delete();
                index.insert(session, this, row);
            }
        } finally {
            writeUnlock();
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:20,代码来源:RowStoreAVL.java

示例5: dropIndexFromRows

import org.hsqldb.RowAVL; //导入依赖的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

示例6: getNewCachedObject

import org.hsqldb.RowAVL; //导入依赖的package包/类
public CachedObject getNewCachedObject(Session session,
                                       Object object)
                                       {

    Row row = new RowAVL(table, (Object[]) object);

    if (session != null) {
        RowAction.addAction(session, RowAction.ACTION_INSERT, table, row);
    }

    int id = rowIdSequence++;

    row.setPos(id);
    rowIdMap.put(id, row);

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

示例7: dropIndexFromRows

import org.hsqldb.RowAVL; //导入依赖的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

示例8: getAccessor

import org.hsqldb.RowAVL; //导入依赖的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

示例9: indexRows

import org.hsqldb.RowAVL; //导入依赖的package包/类
public final void indexRows() {

        RowIterator it = rowIterator();

        for (int i = 1; i < indexList.length; i++) {
            setAccessor(indexList[i], null);
        }

        while (it.hasNext()) {
            Row row = it.getNextRow();

            if (row instanceof RowAVL) {
                ((RowAVL) row).clearNonPrimaryNodes();
            }

            for (int i = 1; i < indexList.length; i++) {
                indexList[i].insert(null, this, row);
            }
        }
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:RowStoreAVL.java

示例10: getNewCachedObject

import org.hsqldb.RowAVL; //导入依赖的package包/类
public CachedObject getNewCachedObject(Session session, Object object,
                                       boolean tx) {

    int id;

    synchronized (this) {
        id = rowIdSequence++;
    }

    Row row = new RowAVL(table, (Object[]) object, id, this);

    if (tx) {
        RowAction action = new RowAction(session, table,
                                         RowAction.ACTION_INSERT, row,
                                         null);

        row.rowAction = action;
    }

    return row;
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:22,代码来源:RowStoreAVLMemory.java

示例11: delete

import org.hsqldb.RowAVL; //导入依赖的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

示例12: indexRows

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

        for (int i = 1; i < indexList.length; i++) {
            setAccessor(indexList[i], null);
        }

        RowIterator it = rowIterator();

        while (it.hasNext()) {
            Row row = it.getNextRow();

            ((RowAVL) row).clearNonPrimaryNodes();

            for (int i = 1; i < indexList.length; i++) {
                indexList[i].insert(session, this, row);
            }
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:19,代码来源:RowStoreAVL.java

示例13: rollbackRow

import org.hsqldb.RowAVL; //导入依赖的package包/类
public void rollbackRow(Session session, Row row, int changeAction,
                        int txModel) {

    switch (changeAction) {

        case RowAction.ACTION_DELETE :
            row = (Row) get(row, true);

            ((RowAVL) row).setNewNodes(this);
            row.keepInMemory(false);
            indexRow(session, row);
            break;

        case RowAction.ACTION_INSERT :
            delete(session, row);
            remove(row.getPos());
            break;

        case RowAction.ACTION_INSERT_DELETE :

            // INSERT + DELEETE
            remove(row.getPos());
            break;
    }
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:26,代码来源:RowStoreAVLHybrid.java

示例14: indexRow

import org.hsqldb.RowAVL; //导入依赖的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

示例15: dropIndexFromRows

import org.hsqldb.RowAVL; //导入依赖的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


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