public class DoubleDistanceDBIDPairList extends Object implements ModifiableDoubleDistanceDBIDList
Modifier and Type | Class and Description |
---|---|
protected class |
DoubleDistanceDBIDPairList.Itr
Iterator class.
|
Modifier and Type | Field and Description |
---|---|
(package private) ArrayList<DoubleDistanceDBIDPair> |
storage
Actual storage.
|
Constructor and Description |
---|
DoubleDistanceDBIDPairList()
Constructor.
|
DoubleDistanceDBIDPairList(int initialCapacity)
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.
Pass a double value instead.
|
void |
clear()
Clear the list contents.
|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DoubleDistanceDBIDPair |
get(int off)
Access a single pair.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DoubleDistanceDBIDListIter |
iter()
Get an iterator
|
int |
size()
Size of list.
|
void |
sort()
Sort the result in ascending order
|
String |
toString() |
final ArrayList<DoubleDistanceDBIDPair> storage
public DoubleDistanceDBIDPairList()
public DoubleDistanceDBIDPairList(int initialCapacity)
initialCapacity
- Capacity@Deprecated public void add(DoubleDistance dist, DBIDRef id)
add
in interface ModifiableDistanceDBIDList<DoubleDistance>
add
in interface ModifiableDoubleDistanceDBIDList
dist
- Distanceid
- IDpublic void add(double dist, DBIDRef id)
add
in interface ModifiableDoubleDistanceDBIDList
dist
- Distanceid
- IDpublic void add(DoubleDistanceDBIDPair pair)
add
in interface ModifiableDoubleDistanceDBIDList
pair
- Pair to addpublic void clear()
ModifiableDoubleDistanceDBIDList
clear
in interface ModifiableDoubleDistanceDBIDList
public void sort()
ModifiableDistanceDBIDList
sort
in interface ModifiableDistanceDBIDList<DoubleDistance>
public int size()
DistanceDBIDList
size
in interface DBIDs
size
in interface DistanceDBIDList<DoubleDistance>
public DoubleDistanceDBIDPair get(int off)
DistanceDBIDList
get
in interface DistanceDBIDList<DoubleDistance>
get
in interface DoubleDistanceDBIDList
off
- Offsetpublic DoubleDistanceDBIDListIter iter()
DistanceDBIDList
iter
in interface DBIDs
iter
in interface DistanceDBIDList<DoubleDistance>
iter
in interface DoubleDistanceDBIDList
public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs