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:
If you are only interested in the IDs of the objects, the following is also sufficient: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 interfaceDoubleDBIDList.ConsumerConsumer for (DBIDRef, double) pairs.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DBIDVarassignVar(int index, DBIDVar var)Assign a DBID variable the value of positionindex.doubledoubleValue(int index)Get the double value at a given index (to access the DBID, either useiter()orassignVar(int, elki.database.ids.DBIDVar).default voidforEachDouble(DoubleDBIDList.Consumer action)Execute a function for each ID.DoubleDBIDListIteriter()Get a DBID iterator (a more efficient API).intsize()Retrieve the collection / data size.DoubleDBIDListslice(int begin, int end)Get a subset list.
-
-
-
Method Detail
-
size
int size()
Description copied from interface:DBIDsRetrieve 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: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 }
-
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
-
-