Interface Relation<O>

    • Method Detail

      • get

        O get​(DBIDRef id)
        Get the representation of an object.
        Parameters:
        id - Object ID
        Returns:
        object instance
      • getDataTypeInformation

        SimpleTypeInformation<O> getDataTypeInformation()
        Get the data type of this representation
        Returns:
        Data type
      • getDBIDs

        DBIDs getDBIDs()
        Get the IDs the query is defined for.

        If possible, prefer iterDBIDs().

        Returns:
        IDs this is defined for
      • iterDBIDs

        DBIDIter iterDBIDs()
        Get an iterator access to the DBIDs.

        To iterate over all IDs, use the following code fragment:

         
         for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {
            relation.get(iter); // Get the current element
         }
         
         
        Returns:
        iterator for the DBIDs.
      • size

        int size()
        Get the number of DBIDs.
        Returns:
        Size
      • getLongName

        java.lang.String getLongName()
        Get a long (human readable) name for the relation.
        Returns:
        Relation name
      • forEach

        default void forEach​(java.util.function.BiConsumer<? super DBIDRef,​? super O> action)
        Execute a function for each ID.
        Parameters:
        action - Action to execute