Class DBIDView

  • All Implemented Interfaces:
    Relation<DBID>

    public class DBIDView
    extends java.lang.Object
    implements Relation<DBID>
    Pseudo-representation that is the object ID itself.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • ids

        private DBIDs ids
        The ids object
    • Constructor Detail

      • DBIDView

        public DBIDView​(DBIDs ids)
        Constructor.
        Parameters:
        ids - DBIDs
    • Method Detail

      • get

        public DBID get​(DBIDRef id)
        Description copied from interface: Relation
        Get the representation of an object.
        Specified by:
        get in interface Relation<DBID>
        Parameters:
        id - Object ID
        Returns:
        object instance
      • iterDBIDs

        public DBIDIter iterDBIDs()
        Description copied from interface: Relation
        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
         }
         
         
        Specified by:
        iterDBIDs in interface Relation<DBID>
        Returns:
        iterator for the DBIDs.
      • setDBIDs

        public void setDBIDs​(DBIDs ids)
        Set the DBIDs of the view.
        Parameters:
        ids - IDs to use
      • size

        public int size()
        Description copied from interface: Relation
        Get the number of DBIDs.
        Specified by:
        size in interface Relation<DBID>
        Returns:
        Size
      • getLongName

        public java.lang.String getLongName()
        Description copied from interface: Relation
        Get a long (human readable) name for the relation.
        Specified by:
        getLongName in interface Relation<DBID>
        Returns:
        Relation name