本文整理汇总了Java中org.hsqldb.lib.ArrayUtil.copyArray方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.copyArray方法的具体用法?Java ArrayUtil.copyArray怎么用?Java ArrayUtil.copyArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.copyArray方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRow
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
Object[] getRow(Object[] row) {
if (isGrouped) {
ResultGroup newGroup = new ResultGroup(row);
ResultGroup group = (ResultGroup) groups.get(newGroup);
if (group != null) {
ArrayUtil.copyArray(group.row, row, row.length);
}
} else if (isAggregated) {
if (currGroup != null) {
ArrayUtil.copyArray(currGroup.row, row, row.length);
}
}
return row;
}
示例2: insert
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Used by the methods above. To avoid unnecessary
* creation of arrays The Object[] for data in the Result rows is inserted
* into the table if it has the same length as table row data.
*/
public void insert(Object[] data) throws HsqlException {
if (data.length != columnCount) {
Object[] newdata = getNewRow();
ArrayUtil.copyArray(data, newdata, visibleColumnCount);
data = newdata;
} else {
for (int i = visibleColumnCount; i < columnCount; i++) {
data[i] = null;
}
}
Row r = Row.newRow(this, data);
indexRow(r);
}
示例3: executeSetStatement
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
Result executeSetStatement(Session session) {
Table table = targetTable;
int[] colMap = updateColumnMap; // column map
Expression[] colExpressions = updateExpressions;
Type[] colTypes = table.getColumnTypes();
int index = targetRangeVariables[TriggerDef.NEW_ROW].rangePosition;
Object[] oldData =
session.sessionContext.rangeIterators[index].getCurrentRow()
.getData();
Object[] data = getUpdatedData(session, table, colMap, colExpressions,
colTypes, oldData);
ArrayUtil.copyArray(data, oldData, data.length);
return Result.updateOneResult;
}
示例4: resolveTypes
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void resolveTypes(Session session) {
if (isResolved) {
return;
}
resolveTypesPartOne(session);
resolveTypesPartTwo(session);
ArrayUtil.copyArray(resultTable.colTypes, unionColumnTypes,
unionColumnTypes.length);
for (int i = 0; i < indexStartOrderBy; i++) {
if (exprColumns[i].dataType == null) {
throw Error.error(ErrorCode.X_42567);
}
}
isResolved = true;
return;
}
示例5: resolveTypes
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void resolveTypes(Session session) {
if (isResolved) {
return;
}
resolveTypesPartOne(session);
resolveTypesPartTwo(session);
resolveTypesPartThree(session);
ArrayUtil.copyArray(resultTable.colTypes, unionColumnTypes,
unionColumnTypes.length);
}
示例6: executeTriggerSetStatement
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
Result executeTriggerSetStatement(Session session) {
Table table = targetTable;
int[] colMap = updateColumnMap; // column map
Expression[] colExpressions = updateExpressions;
Type[] colTypes = table.getColumnTypes();
int index = targetRangeVariables[TriggerDef.NEW_ROW].rangePosition;
Object[] oldData = session.sessionContext.triggerArguments[index];
Object[] data = StatementDML.getUpdatedData(session, targets, table,
colMap, colExpressions, colTypes, oldData);
ArrayUtil.copyArray(data, oldData, data.length);
return Result.updateOneResult;
}
示例7: findIndexForColumns
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
IndexUse[] findIndexForColumns(Session session, OrderedIntHashSet set,
int opType, boolean ordered) {
IndexUse[] indexUse = Index.emptyUseArray;
if (set.isEmpty()) {
return Index.emptyUseArray;
}
for (int i = 0, count = indexList.length; i < count; i++) {
Index currentIndex = getIndex(i);
int[] indexcols = currentIndex.getColumns();
int matchCount = ordered ? set.getOrderedStartMatchCount(indexcols)
: set.getStartMatchCount(indexcols);
if (matchCount == 0) {
continue;
}
if (matchCount == set.size()) {
return currentIndex.asArray();
}
if (matchCount == currentIndex.getColumnCount()) {
if (currentIndex.isUnique()) {
return currentIndex.asArray();
}
}
if (indexUse.length == 0
&& matchCount == currentIndex.getColumnCount()) {
indexUse = currentIndex.asArray();
} else {
IndexUse[] newList = new IndexUse[indexUse.length + 1];
ArrayUtil.copyArray(indexUse, newList, indexUse.length);
newList[newList.length - 1] = new IndexUse(currentIndex,
matchCount);
indexUse = newList;
}
}
return indexUse;
}
示例8: getIndexForColumns
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Finds an existing index for a column set or create one for temporary
* tables.
*
* synchronized required for shared INFORMATION_SCHEMA etc. tables
*/
synchronized IndexUse[] getIndexForColumns(Session session,
OrderedIntHashSet set, int opType, boolean ordered) {
IndexUse[] indexUse = Index.emptyUseArray;
if (set.isEmpty()) {
return Index.emptyUseArray;
}
for (int i = 0, count = indexList.length; i < count; i++) {
Index currentIndex = getIndex(i);
int[] indexcols = currentIndex.getColumns();
int matchCount = ordered ? set.getOrderedStartMatchCount(indexcols)
: set.getStartMatchCount(indexcols);
if (matchCount == 0) {
continue;
}
if (matchCount == set.size()) {
return currentIndex.asArray();
}
if (matchCount == currentIndex.getColumnCount()) {
if (currentIndex.isUnique()) {
return currentIndex.asArray();
}
}
if (indexUse.length == 0
&& matchCount == currentIndex.getColumnCount()) {
indexUse = currentIndex.asArray();
} else {
IndexUse[] newList = new IndexUse[indexUse.length + 1];
ArrayUtil.copyArray(indexUse, newList, indexUse.length);
newList[newList.length - 1] = new IndexUse(currentIndex,
matchCount);
indexUse = newList;
}
}
// index is not full;
switch (tableType) {
case TableBase.FUNCTION_TABLE :
case TableBase.SYSTEM_SUBQUERY :
case TableBase.INFO_SCHEMA_TABLE :
case TableBase.VIEW_TABLE :
case TableBase.TEMP_TABLE : {
Index selected = createIndexForColumns(session, set.toArray());
if (selected != null) {
indexUse = selected.asArray();
}
}
}
return indexUse;
}
示例9: addSessionVariable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void addSessionVariable(ColumnSchema variable) {
int index = sessionVariables.size();
if (!sessionVariables.add(variable.getName().name, variable)) {
throw Error.error(ErrorCode.X_42504);
}
Object[] vars = new Object[sessionVariables.size()];
ArrayUtil.copyArray(routineVariables, vars, routineVariables.length);
routineVariables = vars;
routineVariables[index] = variable.getDefaultValue(session);
}
示例10: newUpdateResultMetaData
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public static ResultMetaData newUpdateResultMetaData(Type[] types) {
ResultMetaData md = new ResultMetaData(UPDATE_RESULT_METADATA);
md.columnTypes = new Type[types.length];
md.columnCount = types.length;
md.extendedColumnCount = types.length;
ArrayUtil.copyArray(types, md.columnTypes, types.length);
return md;
}
示例11: getColumnTypes
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public Type[] getColumnTypes() {
if (resultColumnTypes.length == indexLimitVisible) {
return resultColumnTypes;
}
Type[] types = new Type[indexLimitVisible];
ArrayUtil.copyArray(resultColumnTypes, types, types.length);
return types;
}
示例12: getColumnTypes
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public Type[] getColumnTypes() {
if (columnTypes.length == indexLimitVisible) {
return columnTypes;
}
Type[] types = new Type[indexLimitVisible];
ArrayUtil.copyArray(columnTypes, types, types.length);
return types;
}
示例13: addSessionVariable
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void addSessionVariable(ColumnSchema variable) {
int index = sessionVariables.size();
sessionVariables.add(variable.getName().name, variable);
Object[] vars = new Object[sessionVariables.size()];
ArrayUtil.copyArray(routineVariables, vars, routineVariables.length);
routineVariables = vars;
routineVariables[index] = variable.getDefaultValue(session);
}