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>
inner
The wrapped representation where we get the IDs from.private Projection<IN,OUT>
projection
The 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 OUT
get(DBIDRef id)
Get the representation of an object.SimpleTypeInformation<OUT>
getDataTypeInformation()
Get the data type of this representationDBIDs
getDBIDs()
Get the IDs the query is defined for.java.lang.String
getLongName()
Get a long (human readable) name for the relation.DBIDIter
iterDBIDs()
Get an iterator access to the DBIDs.int
size()
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:Relation
Get a long (human readable) name for the relation.- Specified by:
getLongName
in interfaceRelation<IN>
- Returns:
- Relation name
-
get
public OUT get(DBIDRef id)
Description copied from interface:Relation
Get the representation of an object.
-
getDataTypeInformation
public SimpleTypeInformation<OUT> getDataTypeInformation()
Description copied from interface:Relation
Get the data type of this representation- Specified by:
getDataTypeInformation
in interfaceRelation<IN>
- Returns:
- Data type
-
getDBIDs
public DBIDs getDBIDs()
Description copied from interface:Relation
Get the IDs the query is defined for.If possible, prefer
Relation.iterDBIDs()
.
-
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 }
-
-