]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.impl/src/org/simantics/db/impl/TableIntAllocatorAdapter.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / TableIntAllocatorAdapter.java
1 package org.simantics.db.impl;\r
2 \r
3 public class TableIntAllocatorAdapter implements IntAllocatorI {\r
4     private Table<int[]> table;\r
5     public TableIntAllocatorAdapter(Table<int[]> table) {\r
6         this.table = table;\r
7     }\r
8     @Override\r
9     public int allocate(int size) {\r
10         int tableIndex = table.createNewElement(size);\r
11         return table.checkIndexAndGetRealIndex(tableIndex, size);\r
12     }\r
13     @Override\r
14     public int[] getTable() {\r
15         return table.getTable();\r
16     }\r
17 }\r