de.lmu.ifi.dbs.elki.database.relation
Class ProxyView<O>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
      extended by de.lmu.ifi.dbs.elki.database.relation.ProxyView<O>
Type Parameters:
O - Object type
All Implemented Interfaces:
DatabaseQuery, Relation<O>, HierarchicalResult, Result

public class ProxyView<O>
extends AbstractHierarchicalResult
implements Relation<O>

A virtual partitioning of the database. For the accepted DBIDs, access is passed on to the wrapped representation.


Field Summary
private  Database database
          Our database
private  DBIDs idview
          The DBIDs we contain
private  Relation<O> inner
          The wrapped representation where we get the IDs from.
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
ProxyView(Database database, DBIDs idview, Relation<O> inner)
          Constructor.
 
Method Summary
 void delete(DBID id)
          Delete an objects values.
 O get(DBID id)
          Get the representation of an object.
 Database getDatabase()
          Get the associated database.
 SimpleTypeInformation<O> getDataTypeInformation()
          Get the data type of this representation
 DBIDs getDBIDs()
          Get the IDs the query is defined for.
 String getLongName()
          A "pretty" name for the result, for use in titles, captions and menus.
 String getShortName()
          A short name for the result, useful for file names.
 IterableIterator<DBID> iterDBIDs()
          Get an iterator access to the DBIDs.
 void set(DBID id, O val)
          Set an object representation.
 int size()
          Get the number of DBIDs.
static
<O> ProxyView<O>
wrap(Database database, DBIDs idview, Relation<O> inner)
          Constructor-like static method.
 
Methods inherited from class de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
addChildResult, getHierarchy, setHierarchy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.result.HierarchicalResult
getHierarchy, setHierarchy
 

Field Detail

database

private final Database database
Our database


idview

private final 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(Database database,
                 DBIDs idview,
                 Relation<O> inner)
Constructor.

Parameters:
idview - Ids to expose
inner - Inner representation
Method Detail

getDatabase

public Database getDatabase()
Description copied from interface: Relation
Get the associated database. Note: in some situations, this might be null!

Specified by:
getDatabase in interface Relation<O>
Returns:
Database

wrap

public static <O> ProxyView<O> wrap(Database database,
                                    DBIDs idview,
                                    Relation<O> inner)
Constructor-like static method.

Type Parameters:
O - Object type
Parameters:
idview - Ids to expose
inner - Inner representation
Returns:
Instance

get

public O get(DBID 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

set

public void set(DBID id,
                O val)
Description copied from interface: Relation
Set an object representation.

Specified by:
set in interface Relation<O>
Parameters:
id - Object ID
val - Value

delete

public void delete(DBID id)
Description copied from interface: Relation
Delete an objects values.

Specified by:
delete in interface Relation<O>
Parameters:
id - ID to delete

getDBIDs

public DBIDs getDBIDs()
Description copied from interface: Relation
Get the IDs the query is defined for.

Specified by:
getDBIDs in interface Relation<O>
Returns:
IDs this is defined for

iterDBIDs

public IterableIterator<DBID> iterDBIDs()
Description copied from interface: Relation
Get an iterator access to the DBIDs.

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

getDataTypeInformation

public SimpleTypeInformation<O> getDataTypeInformation()
Description copied from interface: Relation
Get the data type of this representation

Specified by:
getDataTypeInformation in interface Relation<O>
Returns:
Data type

getLongName

public String getLongName()
Description copied from interface: Result
A "pretty" name for the result, for use in titles, captions and menus.

Specified by:
getLongName in interface Result
Returns:
result name

getShortName

public String getShortName()
Description copied from interface: Result
A short name for the result, useful for file names.

Specified by:
getShortName in interface Result
Returns:
result name

Release 0.4.0 (2011-09-20_1324)