X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fprocore%2Fcluster%2FArgumentTable.java;fp=bundles%2Forg.simantics.db.procore%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fprocore%2Fcluster%2FArgumentTable.java;h=29cd52d2907fc29fdc73776183ee885f1f7f7735;hp=7a5917206e4847cbc89ab32a095d67c7aa370a52;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ArgumentTable.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ArgumentTable.java index 7a5917206..29cd52d29 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ArgumentTable.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ArgumentTable.java @@ -1,64 +1,64 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.procore.cluster; - -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.impl.ClusterI.Procedure; -import org.simantics.db.impl.ClusterSupport; -import org.simantics.db.impl.Modifier; -import org.simantics.db.impl.Table; -import org.simantics.db.impl.TableFactory; -import org.simantics.db.impl.TableSizeListener; - -public class ArgumentTable extends Table { - ArgumentTable(TableSizeListener sizeListener, int[] header, int headerBase, long[] longs) { - super(TableFactory.getLongFactory(), sizeListener, header, headerBase, longs); - } - int createArgument(long a1) { - int tableIndex = createNewElement(1); - int realIndex = checkIndexAndGetRealIndex(tableIndex, 1); - long[] table = getTable(); - table[realIndex] = a1; - return tableIndex; - } - int createArgument(long a1, long a2) { - int tableIndex = createNewElement(2); - int realIndex = checkIndexAndGetRealIndex(tableIndex, 2); - long[] table = getTable(); - table[realIndex] = a1; - table[++realIndex] = a2; - return tableIndex; - } - int createArgument(long a1, long a2, long a3, long a4, long a5) { - int tableIndex = createNewElement(5); - int realIndex = checkIndexAndGetRealIndex(tableIndex, 5); - long[] table = getTable(); - table[realIndex] = a1; - table[++realIndex] = a2; - table[++realIndex] = a3; - table[++realIndex] = a4; - table[++realIndex] = a5; - return tableIndex; - } - long[] getArguments(int argIndex, int size) { - int realIndex = checkIndexAndGetRealIndex(argIndex, size); - long[] table = getTable(); - long[] dest = new long[size]; - System.arraycopy(table, realIndex, dest, 0, size); - return dest; - } - @Override - public boolean foreach(int setIndex, Procedure procedure, Context context, - ClusterSupport support, Modifier modifier) throws DatabaseException { - throw new UnsupportedOperationException(); - } -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.procore.cluster; + +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.impl.ClusterI.Procedure; +import org.simantics.db.impl.ClusterSupport; +import org.simantics.db.impl.Modifier; +import org.simantics.db.impl.Table; +import org.simantics.db.impl.TableFactory; +import org.simantics.db.impl.TableSizeListener; + +public class ArgumentTable extends Table { + ArgumentTable(TableSizeListener sizeListener, int[] header, int headerBase, long[] longs) { + super(TableFactory.getLongFactory(), sizeListener, header, headerBase, longs); + } + int createArgument(long a1) { + int tableIndex = createNewElement(1); + int realIndex = checkIndexAndGetRealIndex(tableIndex, 1); + long[] table = getTable(); + table[realIndex] = a1; + return tableIndex; + } + int createArgument(long a1, long a2) { + int tableIndex = createNewElement(2); + int realIndex = checkIndexAndGetRealIndex(tableIndex, 2); + long[] table = getTable(); + table[realIndex] = a1; + table[++realIndex] = a2; + return tableIndex; + } + int createArgument(long a1, long a2, long a3, long a4, long a5) { + int tableIndex = createNewElement(5); + int realIndex = checkIndexAndGetRealIndex(tableIndex, 5); + long[] table = getTable(); + table[realIndex] = a1; + table[++realIndex] = a2; + table[++realIndex] = a3; + table[++realIndex] = a4; + table[++realIndex] = a5; + return tableIndex; + } + long[] getArguments(int argIndex, int size) { + int realIndex = checkIndexAndGetRealIndex(argIndex, size); + long[] table = getTable(); + long[] dest = new long[size]; + System.arraycopy(table, realIndex, dest, 0, size); + return dest; + } + @Override + public boolean foreach(int setIndex, Procedure procedure, Context context, + ClusterSupport support, Modifier modifier) throws DatabaseException { + throw new UnsupportedOperationException(); + } +}