本文整理汇总了Java中org.hsqldb.lib.ArrayUtil.resizeArray方法的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.resizeArray方法的具体用法?Java ArrayUtil.resizeArray怎么用?Java ArrayUtil.resizeArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.lib.ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil.resizeArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveAggregates
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
private void resolveAggregates() {
tempSet.clear();
if (isAggregated) {
aggregateCheck = new boolean[indexStartAggregates];
tempSet.addAll(aggregateSet);
indexLimitData = indexLimitExpressions = exprColumns.length
+ tempSet.size();
exprColumns = (Expression[]) ArrayUtil.resizeArray(exprColumns,
indexLimitExpressions);
for (int i = indexStartAggregates, j = 0;
i < indexLimitExpressions; i++, j++) {
Expression e = (Expression) tempSet.get(j);
exprColumns[i] = e.duplicate();
exprColumns[i].nodes = e.nodes; // keep original nodes
exprColumns[i].dataType = e.dataType;
}
tempSet.clear();
}
}
示例2: createAdjustedIndex
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Create new index taking into account removal or addition of a column
* to the table.
*/
private Index createAdjustedIndex(Index index, int colindex,
int adjust) throws HsqlException {
int[] indexcolumns = (int[]) ArrayUtil.resizeArray(index.getColumns(),
index.getVisibleColumns());
int[] colarr = ArrayUtil.toAdjustedColumnArray(indexcolumns, colindex,
adjust);
// if a column to remove is one of the Index columns
if (colarr.length != index.getVisibleColumns()) {
return null;
}
return createIndexStructure(colarr, index.getName(), index.isUnique(),
index.isConstraint, index.isForward);
}
示例3: setBytes
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public int setBytes(SessionInterface session, long pos, byte[] bytes,
int offset, int length) {
if (!isInLimits(data.length, pos, 0)) {
throw new IndexOutOfBoundsException();
}
if (!isInLimits(data.length, pos, length)) {
data = (byte[]) ArrayUtil.resizeArray(data, (int) pos + length);
}
System.arraycopy(bytes, offset, data, (int) pos, length);
bitLength = data.length * 8;
return length;
}
示例4: setRangeIterator
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void setRangeIterator(RangeIterator iterator) {
int position = iterator.getRangePosition();
if (position >= rangeIterators.length) {
rangeIterators =
(RangeIterator[]) ArrayUtil.resizeArray(rangeIterators,
position + 4);
}
rangeIterators[position] = iterator;
}
示例5: readRow
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
Expression readRow() {
Expression r = null;
while (true) {
Expression e = XreadValueExpressionWithContext();
if (r == null) {
r = e;
} else if (r.getType() == OpTypes.ROW) {
if (e.getType() == OpTypes.ROW
&& r.nodes[0].getType() != OpTypes.ROW) {
r = new Expression(OpTypes.ROW, new Expression[] {
r, e
});
} else {
r.nodes = (Expression[]) ArrayUtil.resizeArray(r.nodes,
r.nodes.length + 1);
r.nodes[r.nodes.length - 1] = e;
}
} else {
r = new Expression(OpTypes.ROW, new Expression[] {
r, e
});
}
if (token.tokenType != Tokens.COMMA) {
break;
}
read();
}
return r;
}
示例6: addError
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Adds the error code and the key to the list of errors. This list
* is populated during construction or addition of elements and is used
* outside this class to act upon the errors.
*/
protected void addError(int code, String key) {
errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
errorCodes.length + 1);
errorKeys = (String[]) ArrayUtil.resizeArray(errorKeys,
errorKeys.length + 1);
errorCodes[errorCodes.length - 1] = code;
errorKeys[errorKeys.length - 1] = key;
}
示例7: setBytes
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void setBytes(SessionInterface session, long pos, byte[] bytes,
int offset, int length) {
if (!isInLimits(data.length, pos, 0)) {
throw new IndexOutOfBoundsException();
}
if (!isInLimits(data.length, pos, length)) {
data = (byte[]) ArrayUtil.resizeArray(data, (int) pos + length);
}
System.arraycopy(bytes, offset, data, (int) pos, length);
bitLength = data.length * 8L;
}
示例8: addError
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Adds the error code and the key to the list of errors. This list
* is populated during construction or addition of elements and is used
* outside this class to act upon the errors.
*/
private void addError(int code, String key) {
errorCodes = (int[]) ArrayUtil.resizeArray(errorCodes,
errorCodes.length + 1);
errorKeys = (String[]) ArrayUtil.resizeArray(errorKeys,
errorKeys.length + 1);
errorCodes[errorCodes.length - 1] = code;
errorKeys[errorKeys.length - 1] = key;
}
示例9: truncate
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void truncate(SessionInterface session, long len) {
if (data.length > len) {
data = (byte[]) ArrayUtil.resizeArray(data, (int) len);
bitLength = data.length * 8;
}
}
示例10: addSpecificRoutine
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void addSpecificRoutine(Database database, Routine routine) {
int signature = routine.getParameterSignature();
Type[] types = routine.getParameterTypes();
for (int i = 0; i < this.routines.length; i++) {
if (routines[i].parameterTypes.length == types.length) {
if (routineType == SchemaObject.PROCEDURE) {
throw Error.error(ErrorCode.X_42605);
}
boolean match = true;
for (int j = 0; j < types.length; j++) {
if (!routines[i].parameterTypes[j].equals(types[j])) {
match = false;
break;
}
}
if (match) {
throw Error.error(ErrorCode.X_42605);
}
}
}
if (routine.getSpecificName() == null) {
HsqlName specificName = database.nameManager.newAutoName("",
name.name, name.schema, name, name.type);
routine.setSpecificName(specificName);
}
routines = (Routine[]) ArrayUtil.resizeArray(routines,
routines.length + 1);
routines[routines.length - 1] = routine;
}
示例11: addSpecificRoutine
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public void addSpecificRoutine(HsqlNameManager nameManager,
Routine routine, boolean replace) {
int signature = routine.getParameterSignature();
Type[] types = routine.getParameterTypes();
int matchPosition = routines.length;
for (int i = 0; i < this.routines.length; i++) {
if (routines[i].parameterTypes.length == types.length) {
if (routineType == SchemaObject.PROCEDURE) {
if (!replace) {
throw Error.error(ErrorCode.X_42605);
}
}
if (routines[i].isAggregate() != routine.isAggregate()) {
throw Error.error(ErrorCode.X_42605);
}
boolean match = true;
for (int j = 0; j < types.length; j++) {
if (!routines[i].parameterTypes[j].equals(types[j])) {
match = false;
break;
}
}
if (match) {
if (replace) {
routine.setSpecificName(routines[i].getSpecificName());
matchPosition = i;
break;
} else {
throw Error.error(ErrorCode.X_42605);
}
}
}
}
if (routine.getSpecificName() == null) {
HsqlName specificName = nameManager.newSpecificRoutineName(name);
routine.setSpecificName(specificName);
} else {
routine.getSpecificName().parent = name;
routine.getSpecificName().schema = name.schema;
}
routine.setName(name);
routine.routineSchema = this;
if (matchPosition == routines.length) {
routines = (Routine[]) ArrayUtil.resizeArray(routines,
routines.length + 1);
}
routines[matchPosition] = routine;
}
示例12: XreadRowValueExpressionListBody
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
Expression XreadRowValueExpressionListBody() {
Expression r = null;
while (true) {
int brackets = readOpenBrackets();
Expression e = readRow();
readCloseBrackets(brackets);
if (r == null) {
r = new Expression(OpTypes.ROW, new Expression[]{ e });
} else {
r.nodes = (Expression[]) ArrayUtil.resizeArray(r.nodes,
r.nodes.length + 1);
r.nodes[r.nodes.length - 1] = e;
}
if (token.tokenType != Tokens.COMMA) {
break;
}
read();
}
Expression[] list = r.nodes;
int degree = 1;
if (list[0].getType() == OpTypes.ROW) {
degree = list[0].nodes.length;
}
r.opType = OpTypes.VALUELIST;
for (int i = 0; i < list.length; i++) {
if (list[i].getType() == OpTypes.ROW) {
if (list[i].nodes.length != degree) {
throw Error.error(ErrorCode.X_42564);
}
} else {
if (degree != 1) {
throw Error.error(ErrorCode.X_42564);
}
list[i] = new Expression(OpTypes.ROW,
new Expression[]{ list[i] });
}
}
return r;
}
示例13: compileUpdateStatement
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
/**
* Retrieves an UPDATE-type CompiledStatement from this parse context.
*/
CompiledStatement compileUpdateStatement() throws HsqlException {
String token;
Table table;
int[] colList;
Expression[] exprList;
int len;
Expression cve;
Expression condition;
clearParameters();
TableFilter tableFilter = parseSimpleTableFilter(UserManager.UPDATE);
table = tableFilter.filterTable;
tokenizer.getThis(Token.T_SET);
colList = table.getNewColumnMap();
exprList = new Expression[colList.length];
len = 0;
token = null;
do {
int ci = table.getColumnNr(tokenizer.getName());
String tablename = tokenizer.getLongNameFirst();
if (tablename != null
&& !tableFilter.getName().equals(tablename)) {
throw Trace.error(Trace.TABLE_NOT_FOUND);
}
tokenizer.getThis(Token.T_EQUALS);
cve = parseExpression();
if (len == colList.length) {
// too many (repeat) assignments
throw Trace.error(Trace.COLUMN_COUNT_DOES_NOT_MATCH);
}
colList[len] = ci;
exprList[len] = cve;
token = tokenizer.getSimpleToken();
len++;
} while (token.equals(Token.T_COMMA));
condition = null;
if (token.equals(Token.T_WHERE)) {
condition = parseExpression();
} else {
tokenizer.back();
}
colList = (int[]) ArrayUtil.resizeArray(colList, len);
exprList = (Expression[]) ArrayUtil.resizeArray(exprList, len);
CompiledStatement cs = new CompiledStatement(session, database,
session.currentSchema, tableFilter, colList, exprList, condition,
getSortedSubqueries(), getParameters());
return cs;
}
示例14: getEquiJoinExpressions
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public Expression getEquiJoinExpressions(OrderedHashSet nameSet,
RangeVariable rightRange, boolean fullList) {
HashSet set = new HashSet();
Expression result = null;
OrderedHashSet joinColumnNames = new OrderedHashSet();
for (int i = 0; i < rangeVariableList.size(); i++) {
RangeVariable range = (RangeVariable) rangeVariableList.get(i);
HashMappedList columnList = range.rangeTable.columnList;
for (int j = 0; j < columnList.size(); j++) {
ColumnSchema column = (ColumnSchema) columnList.get(j);
String name = range.getColumnAlias(j).name;
boolean columnInList = nameSet.contains(name);
boolean namedJoin = range.namedJoinColumns != null
&& range.namedJoinColumns.contains(name);
boolean repeated = !namedJoin && !set.add(name);
if (repeated && (!fullList || columnInList)) {
throw Error.error(ErrorCode.X_42578, name);
}
if (!columnInList) {
continue;
}
joinColumnNames.add(name);
int leftPosition =
range.rangeTable.getColumnIndex(column.getNameString());
int rightPosition = rightRange.rangeTable.getColumnIndex(name);
Expression e = new ExpressionLogical(range, leftPosition,
rightRange,
rightPosition);
result = ExpressionLogical.andExpressions(result, e);
ExpressionColumn col = range.getColumnExpression(name);
if (col == null) {
col = new ExpressionColumn(new Expression[] {
e.getLeftNode(), e.getRightNode()
}, name);
range.addNamedJoinColumnExpression(name, col);
} else {
col.nodes = (Expression[]) ArrayUtil.resizeArray(col.nodes,
col.nodes.length + 1);
col.nodes[col.nodes.length - 1] = e.getRightNode();
}
rightRange.addNamedJoinColumnExpression(name, col);
}
}
if (fullList && !joinColumnNames.containsAll(nameSet)) {
throw Error.error(ErrorCode.X_42501);
}
rightRange.addNamedJoinColumns(joinColumnNames);
return result;
}
示例15: getEquiJoinExpressions
import org.hsqldb.lib.ArrayUtil; //导入方法依赖的package包/类
public Expression getEquiJoinExpressions(OrderedHashSet nameSet,
RangeVariable rightRange, boolean fullList) {
HashSet set = new HashSet();
Expression result = null;
OrderedHashSet joinColumnNames = new OrderedHashSet();
for (int i = 0; i < rangeVariableList.size(); i++) {
RangeVariable range = (RangeVariable) rangeVariableList.get(i);
HashMappedList columnList = range.rangeTable.columnList;
for (int j = 0; j < columnList.size(); j++) {
ColumnSchema column = (ColumnSchema) columnList.get(j);
String name = range.getColumnAlias(j);
boolean columnInList = nameSet.contains(name);
boolean namedJoin = range.namedJoinColumns != null
&& range.namedJoinColumns.contains(name);
boolean repeated = !namedJoin && !set.add(name);
if (repeated && (!fullList || columnInList)) {
throw Error.error(ErrorCode.X_42578, name);
}
if (!columnInList) {
continue;
}
joinColumnNames.add(name);
int position = rightRange.rangeTable.getColumnIndex(name);
ColumnSchema rightColumn =
rightRange.rangeTable.getColumn(position);
Expression e = new ExpressionLogical(range, column,
rightRange, rightColumn);
result = ExpressionLogical.andExpressions(result, e);
ExpressionColumn col = range.getColumnExpression(name);
if (col == null) {
col = new ExpressionColumn(new Expression[] {
e.getLeftNode(), e.getRightNode()
}, name);
range.addNamedJoinColumnExpression(name, col);
} else {
col.nodes = (Expression[]) ArrayUtil.resizeArray(col.nodes,
col.nodes.length + 1);
col.nodes[col.nodes.length - 1] = e.getRightNode();
}
rightRange.addNamedJoinColumnExpression(name, col);
}
}
if (fullList && !joinColumnNames.containsAll(nameSet)) {
throw Error.error(ErrorCode.X_42501);
}
rightRange.addNamedJoinColumns(joinColumnNames);
return result;
}