Package elki.database.relation
Interface Relation<O>
-
- Type Parameters:
O
- Object type
- All Known Subinterfaces:
DoubleRelation
,ModifiableRelation<O>
- All Known Implementing Classes:
ConvertToStringView
,DBIDView
,MaterializedDoubleRelation
,MaterializedRelation
,MemoryKDTree.CountingRelation
,ProjectedView
,ProxyView
public interface Relation<O>
An object representation from a database.To search the relation, use
QueryBuilder
.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
forEach(java.util.function.BiConsumer<? super DBIDRef,? super O> action)
Execute a function for each ID.O
get(DBIDRef id)
Get the representation of an object.SimpleTypeInformation<O>
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.
-
-
-
Method Detail
-
get
O get(DBIDRef id)
Get the representation of an object.- Parameters:
id
- Object ID- Returns:
- object instance
-
getDataTypeInformation
SimpleTypeInformation<O> getDataTypeInformation()
Get the data type of this representation- Returns:
- Data type
-
getDBIDs
DBIDs getDBIDs()
Get the IDs the query is defined for.If possible, prefer
iterDBIDs()
.- Returns:
- IDs this is defined for
-
iterDBIDs
DBIDIter iterDBIDs()
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 }
- Returns:
- iterator for the DBIDs.
-
size
int size()
Get the number of DBIDs.- Returns:
- Size
-
getLongName
java.lang.String getLongName()
Get a long (human readable) name for the relation.- Returns:
- Relation name
-
-