Package elki.database.ids
Interface ModifiableDoubleDBIDList
-
- All Superinterfaces:
DBIDs,DoubleDBIDList
- All Known Implementing Classes:
DoubleIntegerDBIDArrayList,DoubleIntegerDBIDKNNList
public interface ModifiableDoubleDBIDList extends DoubleDBIDList
Modifiable API for Distance-DBID results- Since:
- 0.5.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.database.ids.DoubleDBIDList
DoubleDBIDList.Consumer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(double distance, DBIDRef id)Add an object to this result.voidadd(DoubleDBIDPair pair)Add an element.ModifiableDoubleDBIDListclear()Clear the list contents.DoubleDBIDListMIteriter()Get a DBID iterator (a more efficient API).voidremove(int p)Remove the entry at position p by shifting the remainder forward.voidremoveSwap(int p)Remove the entry at position p by swapping with the last (not preserving the order).ModifiableDoubleDBIDListsort()Sort the result in ascending orderModifiableDoubleDBIDListsortDescending()Sort the result in descending ordervoidswap(int i, int j)Swap to entries in the list.-
Methods inherited from interface elki.database.ids.DoubleDBIDList
assignVar, doubleValue, forEachDouble, size, slice
-
-
-
-
Method Detail
-
add
void add(double distance, DBIDRef id)Add an object to this result.- Parameters:
distance- Distance to addid- DBID to add
-
add
void add(DoubleDBIDPair pair)
Add an element.- Parameters:
pair- Pair to add
-
clear
ModifiableDoubleDBIDList clear()
Clear the list contents.
-
sort
ModifiableDoubleDBIDList sort()
Sort the result in ascending order- Returns:
- this
-
sortDescending
ModifiableDoubleDBIDList sortDescending()
Sort the result in descending order- Returns:
- this
-
swap
void swap(int i, int j)Swap to entries in the list.- Parameters:
i- First entryj- Second entry
-
remove
void remove(int p)
Remove the entry at position p by shifting the remainder forward.- Parameters:
p- Entry offset to remove
-
removeSwap
void removeSwap(int p)
Remove the entry at position p by swapping with the last (not preserving the order).- Parameters:
p- Entry offset to remove
-
iter
DoubleDBIDListMIter iter()
Description copied from interface:DBIDsGet a DBID iterator (a more efficient API).Example:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector vec = relation.get(iter); // iter is a temporary object reference }- Specified by:
iterin interfaceDBIDs- Specified by:
iterin interfaceDoubleDBIDList- Returns:
- iterator
-
-