
class DoubleIntegerDBIDList extends Object implements ModifiableDoubleDBIDList, IntegerDBIDs
| Modifier and Type | Class and Description |
|---|---|
private class |
DoubleIntegerDBIDList.Itr
List iterator.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) double[] |
dists
Distance values
|
private static double[] |
EMPTY_DISTS
Empty.
|
private static int[] |
EMPTY_IDS
Empty.
|
(package private) int[] |
ids
DBIDs
|
private static int |
INITIAL_SIZE
Initial size allocation.
|
(package private) int |
size
The size
|
| Modifier | Constructor and Description |
|---|---|
protected |
DoubleIntegerDBIDList()
Constructor.
|
protected |
DoubleIntegerDBIDList(int size)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DoubleDBIDPair pair)
Add an element.
|
void |
add(double dist,
DBIDRef id)
Add an object to this result.
|
protected void |
addInternal(double dist,
int id)
Add an entry, consisting of distance and internal index.
|
void |
clear()
Clear the list contents.
|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DoubleIntegerDBIDPair |
get(int index)
Materialize a single pair.
|
protected void |
grow()
Grow the data storage.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DoubleIntegerDBIDList.Itr |
iter()
Get a DBID iterator (a more efficient API).
|
void |
remove(int p)
Remove the entry at position p by shifting the remainder forward.
|
void |
removeSwap(int p)
Remove the entry at position p by swapping with the last (not preserving
the order).
|
protected void |
reverse()
Reverse the list.
|
int |
size()
Retrieve the collection / data size.
|
void |
sort()
Sort the result in ascending order
|
void |
swap(int i,
int j)
Swap to entries in the list.
|
String |
toString() |
void |
truncate(int newsize)
Truncate the list to the given size, freeing the memory.
|
private static final int INITIAL_SIZE
int size
double[] dists
int[] ids
private static final double[] EMPTY_DISTS
private static final int[] EMPTY_IDS
protected DoubleIntegerDBIDList()
protected DoubleIntegerDBIDList(int size)
size - Initial sizepublic DoubleIntegerDBIDList.Itr iter()
DBIDs
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter in interface DBIDsiter in interface DoubleDBIDListiter in interface IntegerDBIDsiter in interface ModifiableDoubleDBIDListpublic boolean contains(DBIDRef o)
DBIDspublic boolean isEmpty()
DBIDspublic int size()
DBIDssize in interface DBIDssize in interface DoubleDBIDListpublic DoubleIntegerDBIDPair get(int index)
DoubleDBIDListget in interface DoubleDBIDListindex - Offsetprotected void addInternal(double dist,
int id)
dist - Distanceid - Internal indexprotected void grow()
public void add(double dist,
DBIDRef id)
ModifiableDoubleDBIDListadd in interface ModifiableDoubleDBIDListdist - Distance to addid - DBID to addpublic void add(DoubleDBIDPair pair)
ModifiableDoubleDBIDListadd in interface ModifiableDoubleDBIDListpair - Pair to addpublic void clear()
ModifiableDoubleDBIDListclear in interface ModifiableDoubleDBIDListpublic void sort()
ModifiableDoubleDBIDListsort in interface ModifiableDoubleDBIDListprotected void reverse()
public void remove(int p)
ModifiableDoubleDBIDListremove in interface ModifiableDoubleDBIDListp - Entry offset to removepublic void removeSwap(int p)
ModifiableDoubleDBIDListremoveSwap in interface ModifiableDoubleDBIDListp - Entry offset to removepublic void swap(int i,
int j)
ModifiableDoubleDBIDListswap in interface ModifiableDoubleDBIDListi - First entryj - Second entrypublic void truncate(int newsize)
newsize - New sizeCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.