de.lmu.ifi.dbs.elki.database.ids.integer
Class ReusingDBIDFactory

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.ids.integer.SimpleDBIDFactory
      extended by de.lmu.ifi.dbs.elki.database.ids.integer.ReusingDBIDFactory
All Implemented Interfaces:
DBIDFactory

public class ReusingDBIDFactory
extends SimpleDBIDFactory

Slightly more advanced DBID management, that allows reuse of DBIDs.


Field Summary
(package private)  int dynamicStart
          Keep track of the lowest unused dynamic DBID
(package private)  BitSet dynamicUsed
          Bit set to keep track of dynamic DBIDs
private static Logging logger
          Logging for error messages.
(package private)  ArrayList<IntegerDBIDRange> returnedAllocations
          Returned range allocations
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.ids.integer.SimpleDBIDFactory
dynamicids, rangestart
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.ids.DBIDFactory
FACTORY
 
Constructor Summary
ReusingDBIDFactory()
          Constructor
 
Method Summary
 void deallocateDBIDRange(DBIDRange range)
          Deallocate a static DBID range.
 void deallocateSingleDBID(DBID id)
          Return a single DBID for reuse.
 DBID generateSingleDBID()
          Generate a single DBID
 DBIDRange generateStaticDBIDRange(int size)
          Generate a static DBID range.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.ids.integer.SimpleDBIDFactory
getDBIDSerializer, getDBIDSerializerStatic, getTypeRestriction, importInteger, makePair, newArray, newArray, newArray, newHashSet, newHashSet, newHashSet, newTreeSet, newTreeSet, newTreeSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Logging logger
Logging for error messages.


dynamicUsed

BitSet dynamicUsed
Bit set to keep track of dynamic DBIDs


dynamicStart

int dynamicStart
Keep track of the lowest unused dynamic DBID


returnedAllocations

ArrayList<IntegerDBIDRange> returnedAllocations
Returned range allocations

Constructor Detail

ReusingDBIDFactory

public ReusingDBIDFactory()
Constructor

Method Detail

generateSingleDBID

public DBID generateSingleDBID()
Description copied from interface: DBIDFactory
Generate a single DBID

Specified by:
generateSingleDBID in interface DBIDFactory
Overrides:
generateSingleDBID in class SimpleDBIDFactory
Returns:
A single DBID

deallocateSingleDBID

public void deallocateSingleDBID(DBID id)
Description copied from interface: DBIDFactory
Return a single DBID for reuse.

Specified by:
deallocateSingleDBID in interface DBIDFactory
Overrides:
deallocateSingleDBID in class SimpleDBIDFactory
Parameters:
id - DBID to deallocate

generateStaticDBIDRange

public DBIDRange generateStaticDBIDRange(int size)
Description copied from interface: DBIDFactory
Generate a static DBID range.

Specified by:
generateStaticDBIDRange in interface DBIDFactory
Overrides:
generateStaticDBIDRange in class SimpleDBIDFactory
Parameters:
size - Requested size
Returns:
DBID range

deallocateDBIDRange

public void deallocateDBIDRange(DBIDRange range)
Description copied from interface: DBIDFactory
Deallocate a static DBID range.

Specified by:
deallocateDBIDRange in interface DBIDFactory
Overrides:
deallocateDBIDRange in class SimpleDBIDFactory
Parameters:
range - Range to deallocate

Release 0.4.0 (2011-09-20_1324)