本文整理汇总了Java中org.hsqldb.lib.ArrayUtil.areEqual方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.areEqual方法的具体用法?Java ArrayUtil.areEqual怎么用?Java ArrayUtil.areEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.areEqual方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConstraintIndexForColumns
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Returns the index supporting a constraint with the given column signature.
* Only Unique constraints are considered.
*/
Index getConstraintIndexForColumns(int[] col) {
if (ArrayUtil.areEqual(getPrimaryIndex().getColumns(), col,
col.length, true)) {
return getPrimaryIndex();
}
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getType() != Constraint.UNIQUE) {
continue;
}
if (ArrayUtil.areEqual(c.getMainColumns(), col, col.length,
true)) {
return c.getMainIndex();
}
}
return null;
}
示例2: getUniqueConstraintIndexForColumns
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Returns the index supporting a constraint with the given column signature.
* Only Unique constraints are considered.
*/
Index getUniqueConstraintIndexForColumns(int[] col) {
if (ArrayUtil.areEqual(getPrimaryIndex().getColumns(), col,
col.length, true)) {
return getPrimaryIndex();
}
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getType() != Constraint.UNIQUE) {
continue;
}
if (ArrayUtil.areEqual(c.getMainColumns(), col, col.length,
true)) {
return c.getMainIndex();
}
}
return null;
}
示例3: getUniqueConstraintForColumns
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Returns the UNIQUE or PK constraint with the given column signature.
* Modifies the composition of refTableCols if necessary.
*/
Constraint getUniqueConstraintForColumns(int[] mainTableCols, int[] refTableCols) {
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
int type = c.getConstraintType();
if (type != Constraint.UNIQUE && type != Constraint.PRIMARY_KEY) {
continue;
}
int[] constraintCols = c.getMainColumns();
if (constraintCols.length != mainTableCols.length) {
continue;
}
if (ArrayUtil.areEqual(constraintCols, mainTableCols, mainTableCols.length, true)) {
return c;
}
if (ArrayUtil.areEqualSets(constraintCols, mainTableCols)) {
int[] newRefTableCols = new int[mainTableCols.length];
for (int j = 0; j < mainTableCols.length; j++) {
int pos = ArrayUtil.find(constraintCols, mainTableCols[j]);
newRefTableCols[pos] = refTableCols[j];
}
for (int j = 0; j < mainTableCols.length; j++) {
refTableCols[j] = newRefTableCols[j];
}
return c;
}
}
return null;
}