abstract class AbstractIntegerDBIDFactory extends java.lang.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 |
---|---|
DBIDVar |
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.
|
java.lang.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.
|
StaticDBIDs |
makeUnmodifiable(DBIDs existing)
Make DBIDs immutable.
|
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.
|
ModifiableDoubleDBIDList |
newDistanceDBIDList()
Create a modifiable list to store distance-DBID pairs.
|
ModifiableDoubleDBIDList |
newDistanceDBIDList(int size)
Create a modifiable list to store distance-DBID pairs.
|
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.
|
KNNHeap |
newHeap(int k)
Create an heap for kNN search.
|
KNNHeap |
newHeap(KNNList 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.
|
java.lang.String |
toString(DBIDRef id)
Print a DBID as string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deallocateDBIDRange, deallocateSingleDBID, generateSingleDBID, generateStaticDBIDRange, generateStaticDBIDRange
DBID invalid
public DBID importInteger(int id)
DBIDFactory
importInteger
in interface DBIDFactory
id
- Integer ID to importpublic DBIDVar assignVar(DBIDVar var, int val)
DBIDFactory
Note: this may not be possible for some factories!
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 java.lang.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 KNNHeap newHeap(int k)
DBIDFactory
newHeap
in interface DBIDFactory
k
- K valuepublic KNNHeap newHeap(KNNList exist)
DBIDFactory
newHeap
in interface DBIDFactory
exist
- Existing resultpublic ModifiableDoubleDBIDList newDistanceDBIDList(int size)
DBIDFactory
newDistanceDBIDList
in interface DBIDFactory
size
- initial size estimatepublic ModifiableDoubleDBIDList newDistanceDBIDList()
DBIDFactory
newDistanceDBIDList
in interface DBIDFactory
public StaticDBIDs makeUnmodifiable(DBIDs existing)
DBIDFactory
makeUnmodifiable
in interface DBIDFactory
existing
- Existing DBIDspublic ByteBufferSerializer<DBID> getDBIDSerializer()
DBIDFactory
getDBIDSerializer
in interface DBIDFactory
public FixedSizeByteBufferSerializer<DBID> getDBIDSerializerStatic()
DBIDFactory
getDBIDSerializerStatic
in interface DBIDFactory
public java.lang.Class<? extends DBID> getTypeRestriction()
DBIDFactory
getTypeRestriction
in interface DBIDFactory
public DBIDRef invalid()
DBIDFactory
invalid
in interface DBIDFactory
Copyright © 2019 ELKI Development Team. License information.