Package elki.database.ids
Interface DoubleDBIDList
-
- All Superinterfaces:
DBIDs
- All Known Subinterfaces:
DoubleIntegerDBIDList
,KNNList
,ModifiableDoubleDBIDList
- All Known Implementing Classes:
DoubleIntegerDBIDArrayList
,DoubleIntegerDBIDKNNList
,DoubleIntegerDBIDSubList
,IntegerDBIDKNNSubList
public interface DoubleDBIDList extends DBIDs
Collection of double values associated with objects.To iterate over the results, use the following code:
for (DoubleDBIDListIter iter = result.iter(); iter.valid(); iter.advance()) { // You can get the distance via: iter.doubleValue(); // And use iter just like any other DBIDRef }
for (DBIDIter iter = result.iter(); iter.valid(); iter.advance()) { // Use iter just like any other DBIDRef }
- Since:
- 0.5.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
DoubleDBIDList.Consumer
Consumer for (DBIDRef, double) pairs.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DBIDVar
assignVar(int index, DBIDVar var)
Assign a DBID variable the value of positionindex
.double
doubleValue(int index)
Get the double value at a given index (to access the DBID, either useiter()
orassignVar(int, elki.database.ids.DBIDVar)
.default void
forEachDouble(DoubleDBIDList.Consumer action)
Execute a function for each ID.DoubleDBIDListIter
iter()
Get a DBID iterator (a more efficient API).int
size()
Retrieve the collection / data size.DoubleDBIDList
slice(int begin, int end)
Get a subset list.
-
-
-
Method Detail
-
size
int size()
Description copied from interface:DBIDs
Retrieve the collection / data size.
-
assignVar
DBIDVar assignVar(int index, DBIDVar var)
Assign a DBID variable the value of positionindex
.- Parameters:
index
- Positionvar
- Variable to assign the value to.
-
doubleValue
double doubleValue(int index)
Get the double value at a given index (to access the DBID, either useiter()
orassignVar(int, elki.database.ids.DBIDVar)
.- Parameters:
index
- Index- Returns:
- Value
-
iter
DoubleDBIDListIter 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 }
-
slice
DoubleDBIDList slice(int begin, int end)
Get a subset list.- Parameters:
begin
- Beginend
- End- Returns:
- Sublist
-
forEachDouble
default void forEachDouble(DoubleDBIDList.Consumer action)
Execute a function for each ID.- Parameters:
action
- Action to execute
-
-