本文整理汇总了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();
}
示例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();
}