Package elki.database.relation
Class ProjectedView<IN,OUT>
- java.lang.Object
-
- elki.database.relation.ProjectedView<IN,OUT>
-
-
Field Summary
Fields Modifier and Type Field Description private Relation<? extends IN>innerThe wrapped representation where we get the IDs from.private Projection<IN,OUT>projectionThe projection we use.
-
Constructor Summary
Constructors Constructor Description ProjectedView(Relation<? extends IN> inner, Projection<IN,OUT> projection)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OUTget(DBIDRef id)Get the representation of an object.SimpleTypeInformation<OUT>getDataTypeInformation()Get the data type of this representationDBIDsgetDBIDs()Get the IDs the query is defined for.java.lang.StringgetLongName()Get a long (human readable) name for the relation.DBIDIteriterDBIDs()Get an iterator access to the DBIDs.intsize()Get the number of DBIDs.
-
-
-
Field Detail
-
inner
private final Relation<? extends IN> inner
The wrapped representation where we get the IDs from.
-
projection
private Projection<IN,OUT> projection
The projection we use.
-
-
Constructor Detail
-
ProjectedView
public ProjectedView(Relation<? extends IN> inner, Projection<IN,OUT> projection)
Constructor.- Parameters:
inner- Inner relationprojection- Projection function
-
-
Method Detail
-
getLongName
public java.lang.String getLongName()
Description copied from interface:RelationGet a long (human readable) name for the relation.- Specified by:
getLongNamein interfaceRelation<IN>- Returns:
- Relation name
-
get
public OUT get(DBIDRef id)
Description copied from interface:RelationGet the representation of an object.
-
getDataTypeInformation
public SimpleTypeInformation<OUT> getDataTypeInformation()
Description copied from interface:RelationGet the data type of this representation- Specified by:
getDataTypeInformationin interfaceRelation<IN>- Returns:
- Data type
-
getDBIDs
public DBIDs getDBIDs()
Description copied from interface:RelationGet the IDs the query is defined for.If possible, prefer
Relation.iterDBIDs().
-
iterDBIDs
public DBIDIter iterDBIDs()
Description copied from interface:RelationGet 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 }
-
-