public interface DBIDFactory
FACTORY
for the static
instance to use.Modifier and Type | Field and Description |
---|---|
static DBIDFactory |
FACTORY
Static DBID factory to use.
|
Modifier and Type | Method and Description |
---|---|
void |
assignVar(DBIDVar var,
int val)
Assign an integer value to a DBID variable.
|
int |
compare(DBIDRef a,
DBIDRef b)
Compare two DBIDs, for sorting.
|
void |
deallocateDBIDRange(DBIDRange range)
Deallocate a static DBID range.
|
void |
deallocateSingleDBID(DBIDRef id)
Return a single DBID for reuse.
|
boolean |
equal(DBIDRef a,
DBIDRef b)
Compare two DBIDs, for equality testing.
|
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 and integer as DBID.
|
DBIDRef |
invalid()
Get the invalid DBID value, usable as "undefined" placeholder.
|
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.
|
<D extends Distance<D>> |
newDistancePair(D val,
DBIDRef id)
Make a new distance-DBID pair.
|
DoubleDistanceDBIDPair |
newDistancePair(double val,
DBIDRef id)
Make a new distance-DBID pair.
|
DoubleDistanceKNNHeap |
newDoubleDistanceHeap(int k)
Create an appropriate heap for double distances.
|
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.
|
<D extends Distance<D>> |
newHeap(D factory,
int k)
Create an appropriate heap for the distance function.
|
<D extends Distance<D>> |
newHeap(KNNList<D> exist)
Build a new heap from a given list.
|
DBIDPair |
newPair(DBIDRef id1,
DBIDRef id2)
Make a DBID pair from two existing DBIDs.
|
DoubleDBIDPair |
newPair(double val,
DBIDRef id)
Make a double-DBID pair.
|
DBIDVar |
newVar(DBIDRef val)
Make a new DBID variable.
|
String |
toString(DBIDRef id)
Print a DBID as string.
|
static final DBIDFactory FACTORY
DBIDVar newVar(DBIDRef val)
val
- Initial value.DBID importInteger(int id)
id
- Integer ID to importvoid assignVar(DBIDVar var, int val)
var
- Variableval
- Integer valueDBID generateSingleDBID()
void deallocateSingleDBID(DBIDRef id)
id
- DBID to deallocateDBIDRange generateStaticDBIDRange(int size)
size
- Requested sizevoid deallocateDBIDRange(DBIDRange range)
range
- Range to deallocateDBIDPair newPair(DBIDRef id1, DBIDRef id2)
id1
- first DBIDid2
- second DBIDDoubleDBIDPair newPair(double val, DBIDRef id)
val
- Double valueid
- DBID<D extends Distance<D>> DistanceDBIDPair<D> newDistancePair(D val, DBIDRef id)
D
- Distance typeval
- Distance valueid
- Object IDDoubleDistanceDBIDPair newDistancePair(double val, DBIDRef id)
val
- Distance valueid
- Object IDArrayModifiableDBIDs newArray()
HashSetModifiableDBIDs newHashSet()
ArrayModifiableDBIDs newArray(int size)
size
- Size hintHashSetModifiableDBIDs newHashSet(int size)
size
- Size hintArrayModifiableDBIDs newArray(DBIDs existing)
existing
- existing DBIDs to useHashSetModifiableDBIDs newHashSet(DBIDs existing)
existing
- existing DBIDs to use<D extends Distance<D>> KNNHeap<D> newHeap(D factory, int k)
D
- distance typefactory
- distance prototypek
- K value<D extends Distance<D>> KNNHeap<D> newHeap(KNNList<D> exist)
D
- Distance typeexist
- Existing resultDoubleDistanceKNNHeap newDoubleDistanceHeap(int k)
k
- K valueByteBufferSerializer<DBID> getDBIDSerializer()
FixedSizeByteBufferSerializer<DBID> getDBIDSerializerStatic()
Class<? extends DBID> getTypeRestriction()
int compare(DBIDRef a, DBIDRef b)
a
- Firstb
- Secondboolean equal(DBIDRef a, DBIDRef b)
a
- Firstb
- SecondString toString(DBIDRef id)
id
- DBID referenceDBIDRef invalid()