de.lmu.ifi.dbs.elki.database.ids
Interface DBIDFactory

All Known Implementing Classes:
ReusingDBIDFactory, SimpleDBIDFactory, TrivialDBIDFactory

public interface DBIDFactory

Factory interface for generating DBIDs. See FACTORY for the static instance to use.


Field Summary
static DBIDFactory FACTORY
          Static DBID factory to use.
 
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.
 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.
 

Field Detail

FACTORY

static final DBIDFactory FACTORY
Static DBID factory to use.

Method Detail

importInteger

DBID importInteger(int id)
Import an integer ID

Parameters:
id - Integer ID to import
Returns:
DBID

generateSingleDBID

DBID generateSingleDBID()
Generate a single DBID

Returns:
A single DBID

deallocateSingleDBID

void deallocateSingleDBID(DBID id)
Return a single DBID for reuse.

Parameters:
id - DBID to deallocate

generateStaticDBIDRange

DBIDRange generateStaticDBIDRange(int size)
Generate a static DBID range.

Parameters:
size - Requested size
Returns:
DBID range

deallocateDBIDRange

void deallocateDBIDRange(DBIDRange range)
Deallocate a static DBID range.

Parameters:
range - Range to deallocate

makePair

DBIDPair makePair(DBID first,
                  DBID second)
Make a DBID pair from two existing DBIDs.

Parameters:
first - first DBID
second - second DBID
Returns:
new pair.

newArray

ArrayModifiableDBIDs newArray()
Make a new (modifiable) array of DBIDs.

Returns:
New array

newHashSet

HashSetModifiableDBIDs newHashSet()
Make a new (modifiable) hash set of DBIDs.

Returns:
New hash set

newTreeSet

TreeSetModifiableDBIDs newTreeSet()
Make a new (modifiable) tree set of DBIDs.

Returns:
New tree set

newArray

ArrayModifiableDBIDs newArray(int size)
Make a new (modifiable) array of DBIDs.

Parameters:
size - Size hint
Returns:
New array

newHashSet

HashSetModifiableDBIDs newHashSet(int size)
Make a new (modifiable) hash set of DBIDs.

Parameters:
size - Size hint
Returns:
New hash set

newTreeSet

TreeSetModifiableDBIDs newTreeSet(int size)
Make a new (modifiable) tree set of DBIDs.

Parameters:
size - Size hint
Returns:
New tree set

newArray

ArrayModifiableDBIDs newArray(DBIDs existing)
Make a new (modifiable) array of DBIDs.

Parameters:
existing - existing DBIDs to use
Returns:
New array

newHashSet

HashSetModifiableDBIDs newHashSet(DBIDs existing)
Make a new (modifiable) hash set of DBIDs.

Parameters:
existing - existing DBIDs to use
Returns:
New hash set

newTreeSet

TreeSetModifiableDBIDs newTreeSet(DBIDs existing)
Make a new (modifiable) tree set of DBIDs.

Parameters:
existing - existing DBIDs to use
Returns:
New tree set

getDBIDSerializer

ByteBufferSerializer<DBID> getDBIDSerializer()
Get a serializer for DBIDs

Returns:
DBID serializer

getDBIDSerializerStatic

FixedSizeByteBufferSerializer<DBID> getDBIDSerializerStatic()
Get a serializer for DBIDs with static size

Returns:
DBID serializer

getTypeRestriction

Class<? extends DBID> getTypeRestriction()
Get type restriction

Returns:
type restriction for DBIDs

Release 0.4.0 (2011-09-20_1324)