/******************************************************************************* * 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; import org.simantics.db.impl.IntAllocatorI; import org.simantics.db.impl.Modifier; final class TableIntSet2 { public static final int HeaderSize = IntHash.HeaderSize; static int create(int[] keys, int vals[], IntAllocatorI allocator) { return IntHash2.create(keys, vals, allocator); } /** * @param table * @param base * @param object * @param allocator * @return base if object was actually added. Base can be new if new memory is allocated. */ static int addInt(int[] table, int base, int key, int val, IntAllocatorI allocator) { return IntHash2.add(table, base, key, val, allocator); } static boolean removeInt(int[] table, int base, int key) { return IntHash2.remove(table, base, key); } static int getSize(int[] table, int base) { return IntHash2.getUsedSize(table, base); } static int getAllocatedSize(int[] table, int base) { return IntHash2.getAllocatedSize(table, base); } static boolean foreachInt(int[] table, int base , ClusterI.PredicateProcedure procedure, Context context, Modifier modifier) throws DatabaseException { return IntHash2.foreachInt(table, base, procedure, context, modifier); } static boolean contains(int[] table, int base, int key) { return IntHash2.contains(table, base, key); } static int get(int[] table, int base, int key) { return IntHash2.get(table, base, key); } }