summaryrefslogtreecommitdiff
path: root/src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java')
-rw-r--r--src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java b/src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java
index c3abd43a..33ddd240 100644
--- a/src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java
+++ b/src/de/lmu/ifi/dbs/elki/database/ids/integer/SimpleDBIDFactory.java
@@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.database.ids.integer;
This file is part of ELKI:
Environment for Developing KDD-Applications Supported by Index-Structures
- Copyright (C) 2013
+ Copyright (C) 2014
Ludwig-Maximilians-Universität München
Lehr- und Forschungseinheit für Datenbanksysteme
ELKI Development Team
@@ -48,7 +48,7 @@ public class SimpleDBIDFactory extends AbstractIntegerDBIDFactory {
* The starting point for static DBID range allocations.
*/
int rangestart = 0;
-
+
/**
* Constructor.
*/
@@ -81,6 +81,16 @@ public class SimpleDBIDFactory extends AbstractIntegerDBIDFactory {
}
@Override
+ public DBIDRange generateStaticDBIDRange(int begin, int size) {
+ if(begin + size >= Integer.MAX_VALUE) {
+ throw new AbortException("DBID range allocation error - too many objects allocated!");
+ }
+ DBIDRange alloc = new IntegerDBIDRange(begin, size);
+ rangestart = Math.max(rangestart, begin + size);
+ return alloc;
+ }
+
+ @Override
public void deallocateDBIDRange(DBIDRange range) {
// ignore.
}