D
- Distance typepublic class GenericDistanceDBIDList<D extends Distance<D>> extends Object implements ModifiableDistanceDBIDList<D>
Modifier and Type | Class and Description |
---|---|
protected class |
GenericDistanceDBIDList.Itr
Iterator class.
|
Modifier and Type | Field and Description |
---|---|
(package private) int |
size
Current size.
|
(package private) Object[] |
storage
Actual storage.
|
Constructor and Description |
---|
GenericDistanceDBIDList()
Constructor.
|
GenericDistanceDBIDList(int initialCapacity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(D dist,
DBIDRef id)
Add an object to this result.
|
void |
add(DistanceDBIDPair<D> pair)
Add a prepared pair.
|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
private void |
ensureSize(int size) |
DistanceDBIDPair<D> |
get(int off)
Access a single pair.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DistanceDBIDListIter<D> |
iter()
Get an iterator
|
int |
size()
Size of list.
|
void |
sort()
Sort the result in ascending order
|
String |
toString() |
Object[] storage
int size
public GenericDistanceDBIDList()
public GenericDistanceDBIDList(int initialCapacity)
initialCapacity
- Capacitypublic void add(D dist, DBIDRef id)
ModifiableDistanceDBIDList
add
in interface ModifiableDistanceDBIDList<D extends Distance<D>>
dist
- Distance to addid
- DBID to addpublic void add(DistanceDBIDPair<D> pair)
pair
- Pair to addprivate void ensureSize(int size)
public void sort()
ModifiableDistanceDBIDList
sort
in interface ModifiableDistanceDBIDList<D extends Distance<D>>
public int size()
DistanceDBIDList
public DistanceDBIDPair<D> get(int off)
DistanceDBIDList
get
in interface DistanceDBIDList<D extends Distance<D>>
off
- Offsetpublic DistanceDBIDListIter<D> iter()
DistanceDBIDList
public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs