public class DoubleDistanceIntegerDBIDPairList extends Object implements ModifiableDoubleDistanceDBIDList, IntegerDBIDs
Modifier and Type | Class and Description |
---|---|
private class |
DoubleDistanceIntegerDBIDPairList.Itr
List iterator.
|
Modifier and Type | Field and Description |
---|---|
(package private) DoubleDistanceIntegerDBIDPair[] |
data
Distance values
|
(package private) int |
size
The size
|
Constructor and Description |
---|
DoubleDistanceIntegerDBIDPairList()
Constructor.
|
DoubleDistanceIntegerDBIDPairList(int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double dist,
DBIDRef id)
Add an element.
|
void |
add(DoubleDistanceDBIDPair pair)
Add an element.
|
void |
add(DoubleDistance dist,
DBIDRef id)
Deprecated.
|
protected void |
addInternal(DoubleDistanceIntegerDBIDPair pair)
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.
|
DoubleDistanceIntegerDBIDPair |
get(int index)
Access a single pair.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DoubleDistanceIntegerDBIDListIter |
iter()
Get an iterator
|
protected void |
reverse()
Reverse the list.
|
int |
size()
Size of list.
|
void |
sort()
Sort the result in ascending order
|
String |
toString() |
int size
DoubleDistanceIntegerDBIDPair[] data
public DoubleDistanceIntegerDBIDPairList()
public DoubleDistanceIntegerDBIDPairList(int size)
size
- Initial sizepublic DoubleDistanceIntegerDBIDListIter iter()
DistanceDBIDList
iter
in interface DBIDs
iter
in interface DistanceDBIDList<DoubleDistance>
iter
in interface DoubleDistanceDBIDList
iter
in interface IntegerDBIDs
public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs
public int size()
DistanceDBIDList
size
in interface DBIDs
size
in interface DistanceDBIDList<DoubleDistance>
public DoubleDistanceIntegerDBIDPair get(int index)
DistanceDBIDList
get
in interface DistanceDBIDList<DoubleDistance>
get
in interface DoubleDistanceDBIDList
index
- Offsetprotected void addInternal(DoubleDistanceIntegerDBIDPair pair)
pair
- entry@Deprecated public void add(DoubleDistance dist, DBIDRef id)
ModifiableDoubleDistanceDBIDList
add
in interface ModifiableDistanceDBIDList<DoubleDistance>
add
in interface ModifiableDoubleDistanceDBIDList
dist
- Distanceid
- IDpublic void add(double dist, DBIDRef id)
ModifiableDoubleDistanceDBIDList
add
in interface ModifiableDoubleDistanceDBIDList
dist
- Distanceid
- IDpublic void add(DoubleDistanceDBIDPair pair)
ModifiableDoubleDistanceDBIDList
add
in interface ModifiableDoubleDistanceDBIDList
pair
- Pair to addpublic void clear()
ModifiableDoubleDistanceDBIDList
clear
in interface ModifiableDoubleDistanceDBIDList
public void sort()
ModifiableDistanceDBIDList
sort
in interface ModifiableDistanceDBIDList<DoubleDistance>
protected void reverse()