-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db.procore.cluster;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.impl.ClusterI;\r
-import org.simantics.db.impl.IntAllocatorI;\r
-import org.simantics.db.impl.Modifier;\r
-import org.simantics.db.impl.graph.ReadGraphImpl;\r
-import org.simantics.db.impl.query.QueryProcessor;\r
-import org.simantics.db.procedure.AsyncMultiProcedure;\r
-\r
-final class TableIntSet {\r
- public static final int HeaderSize = IntHash.HeaderSize;\r
-// static int create(int initialSize, IntAllocatorI allocator) {\r
-// return IntHash.create(initialSize, allocator);\r
-// }\r
- static int create(int[] ints, IntAllocatorI allocator) {\r
- return IntHash.create(ints, allocator);\r
- }\r
-\r
- /**\r
- * @param table\r
- * @param base\r
- * @param object\r
- * @param allocator\r
- * @return true if object was actually added.\r
- */\r
- static int addInt(int[] table, int base, int object, IntAllocatorI allocator) {\r
- return IntHash.add(table, base, object, allocator);\r
- }\r
- \r
- static boolean removeInt(int[] table, int base, int object) {\r
- return IntHash.remove(table, base, object);\r
- }\r
-\r
- static int removeIntLast(int[] table, int base)\r
- throws DatabaseException {\r
- return IntHash.removeLast(table, base);\r
- }\r
-\r
- static int getSize(int[] table, int base) {\r
- return IntHash.getUsedSize(table, base);\r
- }\r
- \r
- static int getAllocatedSize(int[] table, int base) {\r
- return IntHash.getAllocatedSize(table, base);\r
- }\r
- \r
- static void foreachInt(int[] table, int base, QueryProcessor processor, ReadGraphImpl graph, AsyncMultiProcedure<Resource> procedure, Modifier modifier) throws DatabaseException {\r
- IntHash.foreachInt(graph, table, base, procedure, modifier);\r
- }\r
-\r
- static <Context> boolean foreachInt(int[] table, int base\r
- , ClusterI.ObjectProcedure<Context> procedure, Context context, Modifier modifier) throws DatabaseException {\r
- return IntHash.foreachInt(table, base, procedure, context, modifier);\r
- }\r
- \r
- static boolean contains(int[] table, int base, int a) {\r
- return IntHash.contains(table, base, a);\r
- }\r
-}\r
-\r
+/*******************************************************************************
+ * 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<Resource> procedure, Modifier modifier) throws DatabaseException {
+ IntHash.foreachInt(graph, table, base, procedure, modifier);
+ }
+
+ static <Context> boolean foreachInt(int[] table, int base
+ , ClusterI.ObjectProcedure<Context> 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);
+ }
+}
+