abstract class AbstractIntegerDBIDFactory extends Object implements DBIDFactory
Modifier and Type | Field and Description |
---|---|
(package private) DBID |
invalid
Invalid ID.
|
FACTORY
Constructor and Description |
---|
AbstractIntegerDBIDFactory() |
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.
|
boolean |
equal(DBIDRef a,
DBIDRef b)
Compare two DBIDs, for equality testing.
|
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 first,
DBIDRef second)
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deallocateDBIDRange, deallocateSingleDBID, generateSingleDBID, generateStaticDBIDRange
DBID invalid
public DBID importInteger(int id)
DBIDFactory
importInteger
in interface DBIDFactory
id
- Integer ID to importpublic void assignVar(DBIDVar var, int val)
DBIDFactory
assignVar
in interface DBIDFactory
var
- Variableval
- Integer valuepublic int compare(DBIDRef a, DBIDRef b)
DBIDFactory
compare
in interface DBIDFactory
a
- Firstb
- Secondpublic boolean equal(DBIDRef a, DBIDRef b)
DBIDFactory
equal
in interface DBIDFactory
a
- Firstb
- Secondpublic String toString(DBIDRef id)
DBIDFactory
toString
in interface DBIDFactory
id
- DBID referencepublic DBIDVar newVar(DBIDRef val)
DBIDFactory
newVar
in interface DBIDFactory
val
- Initial value.public ArrayModifiableDBIDs newArray()
DBIDFactory
newArray
in interface DBIDFactory
public HashSetModifiableDBIDs newHashSet()
DBIDFactory
newHashSet
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 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 DBIDPair newPair(DBIDRef first, DBIDRef second)
DBIDFactory
newPair
in interface DBIDFactory
first
- first DBIDsecond
- second DBIDpublic DoubleDBIDPair newPair(double val, DBIDRef id)
DBIDFactory
newPair
in interface DBIDFactory
val
- Double valueid
- DBIDpublic <D extends Distance<D>> DistanceDBIDPair<D> newDistancePair(D val, DBIDRef id)
DBIDFactory
newDistancePair
in interface DBIDFactory
D
- Distance typeval
- Distance valueid
- Object IDpublic DoubleDistanceDBIDPair newDistancePair(double val, DBIDRef id)
DBIDFactory
newDistancePair
in interface DBIDFactory
val
- Distance valueid
- Object IDpublic <D extends Distance<D>> KNNHeap<D> newHeap(D factory, int k)
DBIDFactory
newHeap
in interface DBIDFactory
D
- distance typefactory
- distance prototypek
- K valuepublic <D extends Distance<D>> KNNHeap<D> newHeap(KNNList<D> exist)
DBIDFactory
newHeap
in interface DBIDFactory
D
- Distance typeexist
- Existing resultpublic DoubleDistanceKNNHeap newDoubleDistanceHeap(int k)
DBIDFactory
newDoubleDistanceHeap
in interface DBIDFactory
k
- K valuepublic 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
public DBIDRef invalid()
DBIDFactory
invalid
in interface DBIDFactory