use of de.lmu.ifi.dbs.elki.database.datastore.WritableDataStore in project elki by elki-project.
the class MemoryDataStoreFactory method makeStorage.
@SuppressWarnings("unchecked")
@Override
public <T> WritableDataStore<T> makeStorage(DBIDs ids, int hints, Class<? super T> dataclass) {
if (Double.class.equals(dataclass)) {
return (WritableDataStore<T>) makeDoubleStorage(ids, hints);
}
if (Integer.class.equals(dataclass)) {
return (WritableDataStore<T>) makeIntegerStorage(ids, hints);
}
if (ids instanceof DBIDRange) {
DBIDRange range = (DBIDRange) ids;
Object[] data = new Object[range.size()];
return new ArrayStore<>(data, range);
} else {
return new MapIntegerDBIDStore<>(ids.size());
}
}
Aggregations