Class ProxyView<O>

  • Type Parameters:
    O - Object type
    All Implemented Interfaces:
    Relation<O>

    public class ProxyView<O>
    extends java.lang.Object
    implements Relation<O>
    A virtual partitioning of the database. For the accepted DBIDs, access is passed on to the wrapped representation.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • idview

        private DBIDs idview
        The DBIDs we contain
      • inner

        private final Relation<O> inner
        The wrapped representation where we get the IDs from.
    • Constructor Detail

      • ProxyView

        public ProxyView​(DBIDs idview,
                         Relation<O> inner)
        Constructor.
        Parameters:
        idview - Ids to expose
        inner - Inner representation
    • Method Detail

      • get

        public O get​(DBIDRef id)
        Description copied from interface: Relation
        Get the representation of an object.
        Specified by:
        get in interface Relation<O>
        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<O>
        Returns:
        iterator for the DBIDs.
      • size

        public int size()
        Description copied from interface: Relation
        Get the number of DBIDs.
        Specified by:
        size in interface Relation<O>
        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<O>
        Returns:
        Relation name
      • setDBIDs

        public void setDBIDs​(DBIDs ids)
        Set the DBIDs to use.
        Parameters:
        ids - DBIDs