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%2FTableIntSet.java;h=a0e0eb14bb813de23b83ecb43362571ddd0c1898;hp=35fd627d813c2eff0f1a257bd0f569a24538eb42;hb=0d9b90834ce56b292c00b1a39850ed842c3e4d42;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/TableIntSet.java b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/TableIntSet.java index 35fd627d8..a0e0eb14b 100644 --- a/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/TableIntSet.java +++ b/bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/TableIntSet.java @@ -1,73 +1,73 @@ -/******************************************************************************* - * 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.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.impl.ClusterI; -import org.simantics.db.impl.IntAllocatorI; -import org.simantics.db.impl.Modifier; -import org.simantics.db.impl.graph.ReadGraphImpl; -import org.simantics.db.impl.query.QueryProcessor; -import org.simantics.db.procedure.AsyncMultiProcedure; - -final class TableIntSet { - public static final int HeaderSize = IntHash.HeaderSize; -// static int create(int initialSize, IntAllocatorI allocator) { -// return IntHash.create(initialSize, allocator); -// } - static int create(int[] ints, IntAllocatorI allocator) { - return IntHash.create(ints, allocator); - } - - /** - * @param table - * @param base - * @param object - * @param allocator - * @return true if object was actually added. - */ - static int addInt(int[] table, int base, int object, IntAllocatorI allocator) { - return IntHash.add(table, base, object, allocator); - } - - static boolean removeInt(int[] table, int base, int object) { - return IntHash.remove(table, base, object); - } - - static int removeIntLast(int[] table, int base) - throws DatabaseException { - return IntHash.removeLast(table, base); - } - - static int getSize(int[] table, int base) { - return IntHash.getUsedSize(table, base); - } - - static int getAllocatedSize(int[] table, int base) { - return IntHash.getAllocatedSize(table, base); - } - - static void foreachInt(int[] table, int base, QueryProcessor processor, ReadGraphImpl graph, AsyncMultiProcedure procedure, Modifier modifier) throws DatabaseException { - IntHash.foreachInt(graph, table, base, procedure, modifier); - } - - static boolean foreachInt(int[] table, int base - , ClusterI.ObjectProcedure procedure, Context context, Modifier modifier) throws DatabaseException { - return IntHash.foreachInt(table, base, procedure, context, modifier); - } - - static boolean contains(int[] table, int base, int a) { - return IntHash.contains(table, base, a); - } -} - +/******************************************************************************* + * 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.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.impl.ClusterI; +import org.simantics.db.impl.IntAllocatorI; +import org.simantics.db.impl.Modifier; +import org.simantics.db.impl.graph.ReadGraphImpl; +import org.simantics.db.impl.query.QueryProcessor; +import org.simantics.db.procedure.SyncMultiProcedure; + +final class TableIntSet { + public static final int HeaderSize = IntHash.HeaderSize; +// static int create(int initialSize, IntAllocatorI allocator) { +// return IntHash.create(initialSize, allocator); +// } + static int create(int[] ints, IntAllocatorI allocator) { + return IntHash.create(ints, allocator); + } + + /** + * @param table + * @param base + * @param object + * @param allocator + * @return true if object was actually added. + */ + static int addInt(int[] table, int base, int object, IntAllocatorI allocator) { + return IntHash.add(table, base, object, allocator); + } + + static boolean removeInt(int[] table, int base, int object) { + return IntHash.remove(table, base, object); + } + + static int removeIntLast(int[] table, int base) + throws DatabaseException { + return IntHash.removeLast(table, base); + } + + static int getSize(int[] table, int base) { + return IntHash.getUsedSize(table, base); + } + + static int getAllocatedSize(int[] table, int base) { + return IntHash.getAllocatedSize(table, base); + } + + static void foreachInt(int[] table, int base, QueryProcessor processor, ReadGraphImpl graph, SyncMultiProcedure procedure, Modifier modifier) throws DatabaseException { + IntHash.foreachInt(graph, table, base, procedure, modifier); + } + + static boolean foreachInt(int[] table, int base + , ClusterI.ObjectProcedure procedure, Context context, Modifier modifier) throws DatabaseException { + return IntHash.foreachInt(table, base, procedure, context, modifier); + } + + static boolean contains(int[] table, int base, int a) { + return IntHash.contains(table, base, a); + } +} +