public class DoubleDistanceDBIDList extends Object implements ModifiableDistanceDBIDResult<DoubleDistance>
Modifier and Type | Class and Description |
---|---|
protected class |
DoubleDistanceDBIDList.Iter
Iterator class.
|
Modifier and Type | Field and Description |
---|---|
(package private) ArrayList<DoubleDistanceDBIDPair> |
storage
Actual storage.
|
Constructor and Description |
---|
DoubleDistanceDBIDList()
Constructor.
|
DoubleDistanceDBIDList(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.
|
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.
|
DoubleDistanceDBIDResultIter |
iter()
Get an iterator
|
int |
size()
Size of list.
|
void |
sort()
Sort the result in ascending order
|
String |
toString() |
final ArrayList<DoubleDistanceDBIDPair> storage
public DoubleDistanceDBIDList()
public DoubleDistanceDBIDList(int initialCapacity)
initialCapacity
- Capacity@Deprecated public void add(DoubleDistance dist, DBIDRef id)
add
in interface ModifiableDistanceDBIDResult<DoubleDistance>
dist
- Distanceid
- IDpublic void add(double dist, DBIDRef id)
dist
- Distanceid
- IDpublic void add(DoubleDistanceDBIDPair pair)
pair
- Pair to addpublic void sort()
ModifiableDistanceDBIDResult
sort
in interface ModifiableDistanceDBIDResult<DoubleDistance>
public int size()
DistanceDBIDResult
size
in interface DBIDs
size
in interface DistanceDBIDResult<DoubleDistance>
public DoubleDistanceDBIDPair get(int off)
DistanceDBIDResult
get
in interface DistanceDBIDResult<DoubleDistance>
off
- Offsetpublic DoubleDistanceDBIDResultIter iter()
DistanceDBIDResult
iter
in interface DBIDs
iter
in interface DistanceDBIDResult<DoubleDistance>
public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs