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


Java ReadWriteLockDummy类代码示例

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


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

示例1: IndexAVL

import org.hsqldb.lib.ReadWriteLockDummy; //导入依赖的package包/类
/**
 * Constructor declaration
 *
 * @param name HsqlName of the index
 * @param id persistnece id
 * @param table table of the index
 * @param columns array of column indexes
 * @param descending boolean[]
 * @param nullsLast boolean[]
 * @param colTypes array of column types
 * @param pk if index is for a primary key
 * @param unique is this a unique index
 * @param constraint does this index belonging to a constraint
 * @param forward is this an auto-index for an FK that refers to a table
 *   defined after this table
 */
public IndexAVL(HsqlName name, long id, TableBase table, int[] columns,
                boolean[] descending, boolean[] nullsLast,
                Type[] colTypes, boolean pk, boolean unique,
                boolean constraint, boolean forward) {

    this.persistenceId = id;
    this.name          = name;
    this.colIndex      = columns;
    this.colTypes      = colTypes;
    this.colDesc       = descending == null ? new boolean[columns.length]
                                            : descending;
    this.nullsLast     = nullsLast == null ? new boolean[columns.length]
                                           : nullsLast;
    this.isPK          = pk;
    this.isUnique      = unique;
    this.isConstraint  = constraint;
    this.isForward     = forward;
    this.table         = table;
    this.colCheck      = table.getNewColumnCheckList();

    ArrayUtil.intIndexesToBooleanArray(colIndex, colCheck);

    this.defaultColMap = new int[columns.length];

    ArrayUtil.fillSequence(defaultColMap);

    boolean simpleOrder = colIndex.length > 0;

    for (int i = 0; i < colDesc.length; i++) {
        if (this.colDesc[i] || this.nullsLast[i]) {
            simpleOrder = false;
        }
    }

    isSimpleOrder = simpleOrder;
    isSimple      = isSimpleOrder && colIndex.length == 1;
    nullData      = new Object[colIndex.length];

    //
    switch (table.getTableType()) {

        case TableBase.MEMORY_TABLE :
        case TableBase.CACHED_TABLE :
        case TableBase.TEXT_TABLE :
            lock = new ReentrantReadWriteLock();
            break;

        default :
            lock = new ReadWriteLockDummy();
            break;
    }

    readLock  = lock.readLock();
    writeLock = lock.writeLock();
}
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:72,代码来源:IndexAVL.java

示例2: IndexAVL

import org.hsqldb.lib.ReadWriteLockDummy; //导入依赖的package包/类
/**
 * Constructor declaration
 *
 * @param name HsqlName of the index
 * @param id persistnece id
 * @param table table of the index
 * @param columns array of column indexes
 * @param descending boolean[]
 * @param nullsLast boolean[]
 * @param colTypes array of column types
 * @param pk if index is for a primary key
 * @param unique is this a unique index
 * @param constraint does this index belonging to a constraint
 * @param forward is this an auto-index for an FK that refers to a table
 *   defined after this table
 */
public IndexAVL(HsqlName name, long id, TableBase table, int[] columns,
                boolean[] descending, boolean[] nullsLast,
                Type[] colTypes, boolean pk, boolean unique,
                boolean constraint, boolean forward) {

    this.persistenceId = id;
    this.name          = name;
    this.colIndex      = columns;
    this.colTypes      = colTypes;
    this.colDesc       = descending == null ? new boolean[columns.length]
                                            : descending;
    this.nullsLast     = nullsLast == null ? new boolean[columns.length]
                                           : nullsLast;
    this.isPK          = pk;
    this.isUnique      = unique;
    this.isConstraint  = constraint;
    this.isForward     = forward;
    this.table         = table;
    this.colCheck      = table.getNewColumnCheckList();
    this.asArray = new IndexUse[]{ new IndexUse(this, colIndex.length) };

    ArrayUtil.intIndexesToBooleanArray(colIndex, colCheck);

    this.defaultColMap = new int[columns.length];

    ArrayUtil.fillSequence(defaultColMap);

    boolean simpleOrder = colIndex.length > 0;

    for (int i = 0; i < colDesc.length; i++) {
        if (this.colDesc[i] || this.nullsLast[i]) {
            simpleOrder = false;
        }
    }

    isSimpleOrder = simpleOrder;
    isSimple      = isSimpleOrder && colIndex.length == 1;
    nullData      = new Object[colIndex.length];

    //
    switch (table.getTableType()) {

        case TableBase.MEMORY_TABLE :
        case TableBase.CACHED_TABLE :
        case TableBase.TEXT_TABLE :
            lock = new ReentrantReadWriteLock();
            break;

        default :
            lock = new ReadWriteLockDummy();
            break;
    }

    readLock  = lock.readLock();
    writeLock = lock.writeLock();
}
 
开发者ID:topahl,项目名称:StoryBear,代码行数:73,代码来源:IndexAVL.java


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