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%2FOperationTable.java;h=d5f5a420f334c18b0d0ccea312c7e7ec62967831;hp=d912a1153935c5b4f4cad73078a5ed6786027a6a;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/OperationTable.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/OperationTable.java index d912a1153..d5f5a420f 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/OperationTable.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/OperationTable.java @@ -1,69 +1,69 @@ -/******************************************************************************* - * 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 OperationTable extends Table { - - OperationTable(TableSizeListener sizeListener, int[] header, int headerBase, int[] ints) { - super(TableFactory.getIntFactory(), sizeListener, header, headerBase, ints); - } - int getOperationCount() { - return getTableCount(); - } - int createOperation(int type, int argIndex, int valIndex, int valSize) { - int tableIndex = createNewElement(4); - int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); - int[] table = getTable(); - table[realIndex] = type; - table[++realIndex] = argIndex; - table[++realIndex] = valIndex; - table[++realIndex] = valSize; - return tableIndex - ZERO_SHIFT; // operation index is zero based - } - int getOperationType(int opIndex) { - int tableIndex = ZERO_SHIFT + opIndex*4; - int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); - int[] table = getTable(); - return table[realIndex]; - } - int getOperationArgumentIndex(int opIndex) { - int tableIndex = ZERO_SHIFT + opIndex*4; - int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); - int[] table = getTable(); - return table[++realIndex]; - } - int getValueIndex(int opIndex) { - int tableIndex = ZERO_SHIFT + opIndex*4; - int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); - int[] table = getTable(); - return table[realIndex+2]; - } - int getValueSize(int opIndex) { - int tableIndex = ZERO_SHIFT + opIndex*4; - int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); - int[] table = getTable(); - return table[realIndex+3]; - } - @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 OperationTable extends Table { + + OperationTable(TableSizeListener sizeListener, int[] header, int headerBase, int[] ints) { + super(TableFactory.getIntFactory(), sizeListener, header, headerBase, ints); + } + int getOperationCount() { + return getTableCount(); + } + int createOperation(int type, int argIndex, int valIndex, int valSize) { + int tableIndex = createNewElement(4); + int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); + int[] table = getTable(); + table[realIndex] = type; + table[++realIndex] = argIndex; + table[++realIndex] = valIndex; + table[++realIndex] = valSize; + return tableIndex - ZERO_SHIFT; // operation index is zero based + } + int getOperationType(int opIndex) { + int tableIndex = ZERO_SHIFT + opIndex*4; + int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); + int[] table = getTable(); + return table[realIndex]; + } + int getOperationArgumentIndex(int opIndex) { + int tableIndex = ZERO_SHIFT + opIndex*4; + int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); + int[] table = getTable(); + return table[++realIndex]; + } + int getValueIndex(int opIndex) { + int tableIndex = ZERO_SHIFT + opIndex*4; + int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); + int[] table = getTable(); + return table[realIndex+2]; + } + int getValueSize(int opIndex) { + int tableIndex = ZERO_SHIFT + opIndex*4; + int realIndex = checkIndexAndGetRealIndex(tableIndex, 4); + int[] table = getTable(); + return table[realIndex+3]; + } + @Override + public boolean foreach(int setIndex, Procedure procedure, Context context, + ClusterSupport support, Modifier modifier) throws DatabaseException { + throw new UnsupportedOperationException(); + } +}