]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.impl/src/org/simantics/db/impl/TableIntAllocatorAdapter.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / TableIntAllocatorAdapter.java
1 package org.simantics.db.impl;
2
3 public class TableIntAllocatorAdapter implements IntAllocatorI {
4     private Table<int[]> table;
5     public TableIntAllocatorAdapter(Table<int[]> table) {
6         this.table = table;
7     }
8     @Override
9     public int allocate(int size) {
10         int tableIndex = table.createNewElement(size);
11         return table.checkIndexAndGetRealIndex(tableIndex, size);
12     }
13     @Override
14     public int[] getTable() {
15         return table.getTable();
16     }
17 }