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
     }
     
     
    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
     }
     
     
    Since:
    0.5.5
    Author:
    Erich Schubert
    • Method Detail

      • size

        int size()
        Description copied from interface: DBIDs
        Retrieve the collection / data size.
        Specified by:
        size in interface DBIDs
        Returns:
        collection size
      • assignVar

        DBIDVar assignVar​(int index,
                          DBIDVar var)
        Assign a DBID variable the value of position index.
        Parameters:
        index - Position
        var - Variable to assign the value to.
      • 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
         }
         
         
        Specified by:
        iter in interface DBIDs
        Returns:
        iterator
      • slice

        DoubleDBIDList slice​(int begin,
                             int end)
        Get a subset list.
        Parameters:
        begin - Begin
        end - End
        Returns:
        Sublist
      • forEachDouble

        default void forEachDouble​(DoubleDBIDList.Consumer action)
        Execute a function for each ID.
        Parameters:
        action - Action to execute