public class TrivialDBIDFactory extends Object implements DBIDFactory
Modifier and Type | Field and Description |
---|---|
(package private) AtomicInteger |
next
Keep track of the smallest dynamic DBID offset not used
|
FACTORY
Constructor and Description |
---|
TrivialDBIDFactory()
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
ByteBufferSerializer<DBID> |
getDBIDSerializer()
Get a serializer for DBIDs
|
FixedSizeByteBufferSerializer<DBID> |
getDBIDSerializerStatic()
Get a serializer for DBIDs with static size
|
Class<? extends DBID> |
getTypeRestriction()
Get type restriction
|
DBID |
importInteger(int id)
Import an integer ID
|
DBIDPair |
makePair(DBID first,
DBID second)
Make a DBID pair from two existing DBIDs.
|
ArrayModifiableDBIDs |
newArray()
Make a new (modifiable) array of DBIDs.
|
ArrayModifiableDBIDs |
newArray(DBIDs existing)
Make a new (modifiable) array of DBIDs.
|
ArrayModifiableDBIDs |
newArray(int size)
Make a new (modifiable) array of DBIDs.
|
HashSetModifiableDBIDs |
newHashSet()
Make a new (modifiable) hash set of DBIDs.
|
HashSetModifiableDBIDs |
newHashSet(DBIDs existing)
Make a new (modifiable) hash set of DBIDs.
|
HashSetModifiableDBIDs |
newHashSet(int size)
Make a new (modifiable) hash set of DBIDs.
|
TreeSetModifiableDBIDs |
newTreeSet()
Make a new (modifiable) tree set of DBIDs.
|
TreeSetModifiableDBIDs |
newTreeSet(DBIDs existing)
Make a new (modifiable) tree set of DBIDs.
|
TreeSetModifiableDBIDs |
newTreeSet(int size)
Make a new (modifiable) tree set of DBIDs.
|
AtomicInteger next
public DBID generateSingleDBID()
DBIDFactory
generateSingleDBID
in interface DBIDFactory
public void deallocateSingleDBID(DBID id)
DBIDFactory
deallocateSingleDBID
in interface DBIDFactory
id
- DBID to deallocatepublic DBIDRange generateStaticDBIDRange(int size)
DBIDFactory
generateStaticDBIDRange
in interface DBIDFactory
size
- Requested sizepublic void deallocateDBIDRange(DBIDRange range)
DBIDFactory
deallocateDBIDRange
in interface DBIDFactory
range
- Range to deallocatepublic DBID importInteger(int id)
DBIDFactory
importInteger
in interface DBIDFactory
id
- Integer ID to importpublic ArrayModifiableDBIDs newArray()
DBIDFactory
newArray
in interface DBIDFactory
public HashSetModifiableDBIDs newHashSet()
DBIDFactory
newHashSet
in interface DBIDFactory
public TreeSetModifiableDBIDs newTreeSet()
DBIDFactory
newTreeSet
in interface DBIDFactory
public ArrayModifiableDBIDs newArray(int size)
DBIDFactory
newArray
in interface DBIDFactory
size
- Size hintpublic HashSetModifiableDBIDs newHashSet(int size)
DBIDFactory
newHashSet
in interface DBIDFactory
size
- Size hintpublic TreeSetModifiableDBIDs newTreeSet(int size)
DBIDFactory
newTreeSet
in interface DBIDFactory
size
- Size hintpublic ArrayModifiableDBIDs newArray(DBIDs existing)
DBIDFactory
newArray
in interface DBIDFactory
existing
- existing DBIDs to usepublic HashSetModifiableDBIDs newHashSet(DBIDs existing)
DBIDFactory
newHashSet
in interface DBIDFactory
existing
- existing DBIDs to usepublic TreeSetModifiableDBIDs newTreeSet(DBIDs existing)
DBIDFactory
newTreeSet
in interface DBIDFactory
existing
- existing DBIDs to usepublic DBIDPair makePair(DBID first, DBID second)
DBIDFactory
makePair
in interface DBIDFactory
first
- first DBIDsecond
- second DBIDpublic ByteBufferSerializer<DBID> getDBIDSerializer()
DBIDFactory
getDBIDSerializer
in interface DBIDFactory
public FixedSizeByteBufferSerializer<DBID> getDBIDSerializerStatic()
DBIDFactory
getDBIDSerializerStatic
in interface DBIDFactory
public Class<? extends DBID> getTypeRestriction()
DBIDFactory
getTypeRestriction
in interface DBIDFactory