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 void
add(double distance, DBIDRef id)
Add an object to this result.void
add(DoubleDBIDPair pair)
Add an element.ModifiableDoubleDBIDList
clear()
Clear the list contents.DoubleDBIDListMIter
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).ModifiableDoubleDBIDList
sort()
Sort the result in ascending orderModifiableDoubleDBIDList
sortDescending()
Sort the result in descending ordervoid
swap(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:DBIDs
Get 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:
iter
in interfaceDBIDs
- Specified by:
iter
in interfaceDoubleDBIDList
- Returns:
- iterator
-
-