本文整理汇总了Java中org.hsqldb.lib.ArrayUtil.countTrueElements方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.countTrueElements方法的具体用法?Java ArrayUtil.countTrueElements怎么用?Java ArrayUtil.countTrueElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.countTrueElements方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasColumnOnly
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
boolean hasColumnOnly(int colIndex) {
switch (constType) {
case SchemaObject.ConstraintTypes.CHECK :
return rangeVariable.usedColumns[colIndex] && ArrayUtil
.countTrueElements(rangeVariable.usedColumns) == 1;
case SchemaObject.ConstraintTypes.PRIMARY_KEY :
case SchemaObject.ConstraintTypes.UNIQUE :
return core.mainCols.length == 1
&& core.mainCols[0] == colIndex;
case SchemaObject.ConstraintTypes.MAIN :
return false;
case SchemaObject.ConstraintTypes.FOREIGN_KEY :
return core.refCols.length == 1 && core.refCols[0] == colIndex;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
}
}
示例2: hasColumnPlus
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
boolean hasColumnPlus(int colIndex) {
switch (constType) {
case SchemaObject.ConstraintTypes.CHECK :
return rangeVariable.usedColumns[colIndex] && ArrayUtil
.countTrueElements(rangeVariable.usedColumns) > 1;
case SchemaObject.ConstraintTypes.PRIMARY_KEY :
case SchemaObject.ConstraintTypes.UNIQUE :
return core.mainCols.length != 1
&& ArrayUtil.find(core.mainCols, colIndex) != -1;
case SchemaObject.ConstraintTypes.MAIN :
return ArrayUtil.find(core.mainCols, colIndex) != -1;
case SchemaObject.ConstraintTypes.FOREIGN_KEY :
return core.refCols.length != 1
&& ArrayUtil.find(core.refCols, colIndex) != -1;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
}
}
示例3: hasColumnOnly
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
boolean hasColumnOnly(int colIndex) {
switch (constType) {
case CHECK :
return rangeVariable.usedColumns[colIndex] && ArrayUtil
.countTrueElements(rangeVariable.usedColumns) == 1;
case PRIMARY_KEY :
case UNIQUE :
return core.mainCols.length == 1
&& core.mainCols[0] == colIndex;
case MAIN :
return core.mainCols.length == 1
&& core.mainCols[0] == colIndex
&& core.mainTable == core.refTable;
case FOREIGN_KEY :
return core.refCols.length == 1 && core.refCols[0] == colIndex
&& core.mainTable == core.refTable;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
}
}
示例4: hasColumnOnly
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
boolean hasColumnOnly(int colIndex) {
switch (constType) {
case SchemaObject.ConstraintTypes.CHECK :
return rangeVariable.usedColumns[colIndex] && ArrayUtil
.countTrueElements(rangeVariable.usedColumns) == 1;
case SchemaObject.ConstraintTypes.PRIMARY_KEY :
case SchemaObject.ConstraintTypes.UNIQUE :
return core.mainCols.length == 1
&& core.mainCols[0] == colIndex;
case SchemaObject.ConstraintTypes.MAIN :
return core.mainCols.length == 1
&& core.mainCols[0] == colIndex
&& core.mainTable == core.refTable;
case SchemaObject.ConstraintTypes.FOREIGN_KEY :
return core.refCols.length == 1 && core.refCols[0] == colIndex
&& core.mainTable == core.refTable;
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
}
}
示例5: hasColumnPlus
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
boolean hasColumnPlus(int colIndex) {
switch (constType) {
case CHECK :
return rangeVariable.usedColumns[colIndex] && ArrayUtil
.countTrueElements(rangeVariable.usedColumns) > 1;
case PRIMARY_KEY :
case UNIQUE :
return core.mainCols.length != 1
&& ArrayUtil.find(core.mainCols, colIndex) != -1;
case MAIN :
return ArrayUtil.find(core.mainCols, colIndex) != -1
&& (core.mainCols.length != 1
|| core.mainTable != core.refTable);
case FOREIGN_KEY :
return ArrayUtil.find(core.refCols, colIndex) != -1
&& (core.mainCols.length != 1
|| core.mainTable == core.refTable);
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
}
}
示例6: hasColumnPlus
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
boolean hasColumnPlus(int colIndex) {
switch (constType) {
case SchemaObject.ConstraintTypes.CHECK :
return rangeVariable.usedColumns[colIndex] && ArrayUtil
.countTrueElements(rangeVariable.usedColumns) > 1;
case SchemaObject.ConstraintTypes.PRIMARY_KEY :
case SchemaObject.ConstraintTypes.UNIQUE :
return core.mainCols.length != 1
&& ArrayUtil.find(core.mainCols, colIndex) != -1;
case SchemaObject.ConstraintTypes.MAIN :
return ArrayUtil.find(core.mainCols, colIndex) != -1
&& (core.mainCols.length != 1
|| core.mainTable != core.refTable);
case SchemaObject.ConstraintTypes.FOREIGN_KEY :
return ArrayUtil.find(core.refCols, colIndex) != -1
&& (core.mainCols.length != 1
|| core.mainTable != core.refTable);
default :
throw Error.runtimeError(ErrorCode.U_S0500, "Constraint");
}
}