Package elki.database.ids.integer
Class TrivialDBIDFactory
- java.lang.Object
-
- elki.database.ids.integer.AbstractIntegerDBIDFactory
-
- elki.database.ids.integer.TrivialDBIDFactory
-
- All Implemented Interfaces:
DBIDFactory
@Priority(100) public final class TrivialDBIDFactory extends AbstractIntegerDBIDFactory
Trivial DBID management, that never reuses IDs and just gives them out in sequence. All IDs will be positive.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.atomic.AtomicInteger
next
Keep track of the smallest dynamic DBID offset not used.-
Fields inherited from class elki.database.ids.integer.AbstractIntegerDBIDFactory
invalid
-
Fields inherited from interface elki.database.ids.DBIDFactory
FACTORY
-
-
Constructor Summary
Constructors Constructor Description TrivialDBIDFactory()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deallocateDBIDRange(DBIDRange range)
Deallocate a static DBID range.void
deallocateSingleDBID(DBIDRef id)
Return a single DBID for reuse.DBID
generateSingleDBID()
Generate a single DBID.DBIDRange
generateStaticDBIDRange(int size)
Generate a static DBID range.DBIDRange
generateStaticDBIDRange(int begin, int size)
Generate a static DBID range.-
Methods inherited from class elki.database.ids.integer.AbstractIntegerDBIDFactory
assignVar, compare, equal, getDBIDSerializer, getDBIDSerializerStatic, getTypeRestriction, importInteger, invalid, makeUnmodifiable, newArray, newArray, newArray, newDistanceDBIDList, newDistanceDBIDList, newHashSet, newHashSet, newHashSet, newHeap, newHeap, newMaxHeap, newMinHeap, newPair, newPair, newVar, toString
-
-
-
-
Method Detail
-
generateSingleDBID
public DBID generateSingleDBID()
Description copied from interface:DBIDFactory
Generate a single DBID.- Returns:
- A single DBID
-
deallocateSingleDBID
public void deallocateSingleDBID(DBIDRef id)
Description copied from interface:DBIDFactory
Return a single DBID for reuse.- Parameters:
id
- DBID to deallocate
-
generateStaticDBIDRange
public DBIDRange generateStaticDBIDRange(int size)
Description copied from interface:DBIDFactory
Generate a static DBID range.- Parameters:
size
- Requested size- Returns:
- DBID range
-
generateStaticDBIDRange
public DBIDRange generateStaticDBIDRange(int begin, int size)
Description copied from interface:DBIDFactory
Generate a static DBID range.- Parameters:
begin
- Range beginsize
- Requested size- Returns:
- DBID range
-
deallocateDBIDRange
public void deallocateDBIDRange(DBIDRange range)
Description copied from interface:DBIDFactory
Deallocate a static DBID range.- Parameters:
range
- Range to deallocate
-
-