public interface DoubleDBIDList extends DBIDs
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
}
If you are only interested in the IDs of the objects, the following is also
sufficient:
for (DBIDIter iter = result.iter(); iter.valid(); iter.advance()) {
// Use iter just like any other DBIDRef
}
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DoubleDBIDList.Consumer
Consumer for (DBIDRef, double) pairs.
|
| Modifier and Type | Method and Description |
|---|---|
DBIDVar |
assignVar(int index,
DBIDVar var)
Assign a DBID variable the value of position
index. |
double |
doubleValue(int index)
Get the double value at a given index (to access the DBID, either use
iter() or assignVar(int, de.lmu.ifi.dbs.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.
|
int size()
DBIDsDBIDVar assignVar(int index, DBIDVar var)
index.index - Positionvar - Variable to assign the value to.double doubleValue(int index)
iter() or assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar).index - IndexDoubleDBIDListIter iter()
DBIDsExample:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
DoubleDBIDList slice(int begin, int end)
begin - Beginend - Enddefault void forEachDouble(DoubleDBIDList.Consumer action)
action - Action to executeCopyright © 2019 ELKI Development Team. License information.