当前位置: 首页>>代码示例>>Java>>正文


Java ArrayUtil类代码示例

本文整理汇总了Java中org.hsqldb.lib.ArrayUtil的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil类的具体用法?Java ArrayUtil怎么用?Java ArrayUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ArrayUtil类属于org.hsqldb.lib包,在下文中一共展示了ArrayUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Index

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
/**
 * Constructor declaration
 *
 *
 * @param name HsqlName of the index
 * @param table table of the index
 * @param column array of column indexes
 * @param type array of column types
 * @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
 * @param visColumns count of visible columns
 */
Index(HsqlName name, Table table, int column[], int type[],
        boolean unique, boolean constraint, boolean forward,
        int visColumns) {

    indexName      = name;
    colIndex       = column;
    colType        = type;
    isUnique       = unique;
    isConstraint   = constraint;
    isForward      = forward;
    colIndex_0     = colIndex[0];
    colType_0      = colType[0];
    visibleColumns = visColumns;
    isExact        = colIndex.length == visibleColumns;
    colCheck       = table.getNewColumnCheckList();

    ArrayUtil.intIndexesToBooleanArray(colIndex, colCheck);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:32,代码来源:Index.java

示例2: release

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
public void release() {

        if (!isCached) {
            destroy();
        }

        if (isCached) {
            cache.adjustStoreCount(-1);

            cache    = null;
            isCached = false;
        }

        elementCount.set(0);
        ArrayUtil.fillArray(accessorList, null);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:17,代码来源:RowStoreAVLHybrid.java

示例3: TableDerived

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
public TableDerived(Database database, HsqlName name, int type,
                    Type[] columnTypes, HashMappedList columnList,
                    QueryExpression queryExpression) {

    this(database, name, type, queryExpression);

    this.colTypes          = columnTypes;
    this.columnList        = columnList;
    columnCount            = columnList.size();
    primaryKeyCols         = ValuePool.emptyIntArray;
    primaryKeyTypes        = Type.emptyArray;
    primaryKeyColsSequence = ValuePool.emptyIntArray;
    colDefaults            = new Expression[columnCount];
    colNotNull             = new boolean[columnCount];
    defaultColumnMap       = new int[columnCount];

    ArrayUtil.fillSequence(defaultColumnMap);

    bestIndexForColumn = new int[colTypes.length];

    ArrayUtil.fillArray(bestIndexForColumn, -1);
    createPrimaryIndex(primaryKeyCols, primaryKeyTypes, null);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:24,代码来源:TableDerived.java

示例4: 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;
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:GroupedResult.java

示例5: addIndex

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
final void addIndex(Session session, Index index) {

        int i = 0;

        for (; i < indexList.length; i++) {
            Index current = indexList[i];
            int order = index.getIndexOrderValue()
                        - current.getIndexOrderValue();

            if (order < 0) {
                break;
            }
        }

        Index[] oldIndexList = indexList;

        indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, index, i,
                1);

        for (i = 0; i < indexList.length; i++) {
            indexList[i].setPosition(i);
        }

        resetAccessorKeys(session, indexList, oldIndexList);
        setBestRowIdentifiers();
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:27,代码来源:TableBase.java

示例6: checkHasMainRef

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
/**
 * For the candidate table row, finds any referring node in the main table.
 * This is used to check referential integrity when updating a node. We
 * have to make sure that the main table still holds a valid main record.
 * returns true If a valid row is found, false if there are null in the data
 * Otherwise a 'INTEGRITY VIOLATION' Exception gets thrown.
 */
boolean checkHasMainRef(Session session, Object[] row) {

    if (ArrayUtil.hasNull(row, core.refCols)) {
        return false;
    }

    PersistentStore store =
        session.sessionData.getRowStore(core.mainTable);
    boolean exists = core.mainIndex.exists(session, store, row,
                                           core.refCols);

    if (!exists) {
        String[] info = new String[] {
            core.refName.name, core.mainTable.getName().name
        };

        throw Error.error(ErrorCode.X_23502, ErrorCode.CONSTRAINT, info);
    }

    return exists;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:29,代码来源:Constraint.java

示例7: resolveTypesPartOne

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
void resolveTypesPartOne(Session session) {

        ArrayUtil.projectRowReverse(leftQueryExpression.unionColumnTypes,
                                    leftQueryExpression.unionColumnMap,
                                    unionColumnTypes);
        leftQueryExpression.resolveTypesPartOne(session);
        ArrayUtil.projectRow(leftQueryExpression.unionColumnTypes,
                             leftQueryExpression.unionColumnMap,
                             unionColumnTypes);
        ArrayUtil.projectRowReverse(rightQueryExpression.unionColumnTypes,
                                    rightQueryExpression.unionColumnMap,
                                    unionColumnTypes);
        rightQueryExpression.resolveTypesPartOne(session);
        ArrayUtil.projectRow(rightQueryExpression.unionColumnTypes,
                             rightQueryExpression.unionColumnMap,
                             unionColumnTypes);
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:18,代码来源:QueryExpression.java

示例8: getBytesCompressed

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
private Result getBytesCompressed(long lobID, long offset, int length,
                                  boolean isClob) {

    byte[]   dataBytes = new byte[length];
    long[][] parts     = getParts(lobID, offset, offset + length);

    for (int i = 0; i < parts.length; i++) {
        long[] part       = parts[i];
        long   partOffset = part[ALLOC_PART.PART_OFFSET];
        int    partLength = (int) part[ALLOC_PART.PART_LENGTH];
        Result result = getPartBytesCompressedInBuffer(lobID, part,
            isClob);

        if (result.isError()) {
            return result;
        }

        ArrayUtil.copyBytes(partOffset, dataBuffer, 0, partLength, offset,
                            dataBytes, length);
    }

    return ResultLob.newLobGetBytesResponse(lobID, offset, dataBytes);
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:24,代码来源:LobManager.java

示例9: insertResult

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
/**
 * Used for subquery inserts. No checks. No identity
 * columns.
 */
int insertResult(Session session, Result ins) throws HsqlException {

    Record ni    = ins.rRoot;
    int    count = 0;

    while (ni != null) {
        Object[] newData =
            (Object[]) ArrayUtil.resizeArrayIfDifferent(ni.data,
                columnCount);

        insertData(session, newData);

        ni = ni.next;

        count++;
    }

    return count;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:Table.java

示例10: getIntegerProperty

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
/**
 * Choice limited to values list, defaultValue must be in the values list.
 */
public int getIntegerProperty(String key, int defaultValue, int[] values) {

    String prop  = getProperty(key);
    int    value = defaultValue;

    try {
        if (prop != null) {
            value = Integer.parseInt(prop);
        }
    } catch (NumberFormatException e) {}

    if (ArrayUtil.find(values, value) == -1) {
        return defaultValue;
    }

    return value;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:HsqlProperties.java

示例11: removeExportedKeys

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
/**
 *  Removes any foreign key Constraint objects (exported keys) held by any
 *  tables referenced by the specified table. <p>
 *
 *  This method is called as the last step of a successful call to
 *  dropTable() in order to ensure that the dropped Table ceases to be
 *  referenced when enforcing referential integrity.
 *
 * @param  toDrop The table to which other tables may be holding keys.
 *      This is a table that is in the process of being dropped.
 */
void removeExportedKeys(Table toDrop) {

    Schema schema = (Schema) schemaMap.get(toDrop.getSchemaName());

    for (int i = 0; i < schema.tableList.size(); i++) {
        Table table = (Table) schema.tableList.get(i);

        for (int j = table.constraintList.length - 1; j >= 0; j--) {
            Table refTable = table.constraintList[j].getRef();

            if (toDrop == refTable) {
                table.constraintList =
                    (Constraint[]) ArrayUtil.toAdjustedArray(
                        table.constraintList, null, j, -1);
            }
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:SchemaManager.java

示例12: union

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
public void union(Session session, RowSetNavigatorData other) {

        Object[] currentData;
        int      colCount = table.getColumnTypes().length;

        removeDuplicates(session);
        other.reset();

        while (other.hasNext()) {
            currentData = other.getNext();

            RowIterator it = findFirstRow(currentData);

            if (!it.hasNext()) {
                currentData =
                    (Object[]) ArrayUtil.resizeArrayIfDifferent(currentData,
                        colCount);

                add(currentData);
            }
        }

        other.release();
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:25,代码来源:RowSetNavigatorDataTable.java

示例13: prepare

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
public void prepare(int degree) {

        columnCount = exprList.size();

        if (columnCount == 0) {
            return;
        }

        sortOrder      = new int[columnCount + degree];
        sortDescending = new boolean[columnCount + degree];
        sortNullsLast  = new boolean[columnCount + degree];

        ArrayUtil.fillSequence(sortOrder);

        for (int i = 0; i < columnCount; i++) {
            ExpressionOrderBy sort = (ExpressionOrderBy) exprList.get(i);

            sortDescending[i] = sort.isDescending();
            sortNullsLast[i]  = sort.isNullsLast();
            hasNullsLast      |= sortNullsLast[i];
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:23,代码来源:SortAndSlice.java

示例14: isEquivalent

import org.hsqldb.lib.ArrayUtil; //导入依赖的package包/类
/**
 * Compares this with another constraint column set. This implementation
 * only checks FOREIGN KEY constraints.
 */
boolean isEquivalent(Table tablemain, int[] colmain, Table tableref,
                     int[] colref) {

    if (constType != Constraint.MAIN
            && constType != Constraint.FOREIGN_KEY) {
        return false;
    }

    if (tablemain != core.mainTable || tableref != core.refTable) {
        return false;
    }

    return ArrayUtil.areEqualSets(core.mainColArray, colmain)
           && ArrayUtil.areEqualSets(core.refColArray, colref);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:Constraint.java

示例15: 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();
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:27,代码来源:QuerySpecification.java


注:本文中的org.hsqldb.lib.ArrayUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。