X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2FTableIntAllocatorAdapter.java;fp=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2FTableIntAllocatorAdapter.java;h=d5111a16a76b81ff00959e13038a3a9ed6b274b9;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/TableIntAllocatorAdapter.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/TableIntAllocatorAdapter.java new file mode 100644 index 000000000..d5111a16a --- /dev/null +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/TableIntAllocatorAdapter.java @@ -0,0 +1,17 @@ +package org.simantics.db.impl; + +public class TableIntAllocatorAdapter implements IntAllocatorI { + private Table table; + public TableIntAllocatorAdapter(Table table) { + this.table = table; + } + @Override + public int allocate(int size) { + int tableIndex = table.createNewElement(size); + return table.checkIndexAndGetRealIndex(tableIndex, size); + } + @Override + public int[] getTable() { + return table.getTable(); + } +}