Commit 5b7ffad1 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

IDbSearchService interface simplified

parent fa1e013f
......@@ -6,7 +6,6 @@ import java.util.List;
import lcsb.mapviewer.common.IProgressUpdater;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.services.view.AbstractView;
/**
* Service that allows to retrieve information of type T from external
......@@ -17,7 +16,7 @@ import lcsb.mapviewer.services.view.AbstractView;
* @param <T>
* type of returned results
*/
public interface IDbSearchService<T extends AbstractView<S>, S> {
public interface IDbSearchService<T> {
/**
* Returns list of objects found by list of names.
......@@ -29,8 +28,7 @@ public interface IDbSearchService<T extends AbstractView<S>, S> {
* {@link lcsb.mapviewer.model.map.model.Model Model})
* @return list of objects for given list of names
*/
List<S> getByNames(List<String> names, DbSearchCriteria searchCriteria);
List<T> getByNames(List<String> names, DbSearchCriteria searchCriteria);
/**
* Returns the drugs found by drug name.
......@@ -42,7 +40,7 @@ public interface IDbSearchService<T extends AbstractView<S>, S> {
* {@link lcsb.mapviewer.model.map.model.Model Model})
* @return list of drugs for drug names
*/
S getByName(String name, DbSearchCriteria searchCriteria);
T getByName(String name, DbSearchCriteria searchCriteria);
/**
* Returns the list of drugs that target at least one of the element in the
......@@ -55,14 +53,7 @@ public interface IDbSearchService<T extends AbstractView<S>, S> {
* {@link lcsb.mapviewer.model.map.model.Model Model})
* @return list of drugs that targets something from the elements collection
*/
List<S> getForTargets(Collection<Element> targetElements, DbSearchCriteria searchCriteria);
/**
* Creates empty {@link T} object.
*
* @return empty {@link T} object
*/
T createEmptyView();
List<T> getForTargets(Collection<Element> targetElements, DbSearchCriteria searchCriteria);
/**
* This method will cache all queries that make sense for the model.
......
......@@ -179,11 +179,6 @@ public class ChemicalService implements IChemicalService {
}
}
@Override
public ChemicalView createEmptyView() {
return chemicalViewFactory.create(null);
}
@Override
public Chemical getByName(String name, DbSearchCriteria searchCriteria) {
if (searchCriteria.getDisease() == null) {
......
......@@ -9,6 +9,6 @@ import lcsb.mapviewer.services.search.db.IDbSearchService;
* @author Ayan Rota
*
*/
public interface IChemicalService extends IDbSearchService<ChemicalView, Chemical> {
public interface IChemicalService extends IDbSearchService<Chemical> {
}
......@@ -371,11 +371,6 @@ public class DrugService implements IDrugService {
this.pubmedParser = pubmedParser;
}
@Override
public DrugView createEmptyView() {
return drugViewFactory.create(null);
}
@Override
public void cacheDataForModel(Model originalModel, IProgressUpdater iProgressUpdater) {
logger.debug("Caching drug queries...");
......
......@@ -9,6 +9,6 @@ import lcsb.mapviewer.services.search.db.IDbSearchService;
* @author Piotr Gawron
*
*/
public interface IDrugService extends IDbSearchService<DrugView, Drug> {
public interface IDrugService extends IDbSearchService<Drug> {
}
......@@ -9,6 +9,6 @@ import lcsb.mapviewer.services.search.db.IDbSearchService;
* @author Ayan Rota
*
*/
public interface IMiRNAService extends IDbSearchService<MiRNAView, MiRNA> {
public interface IMiRNAService extends IDbSearchService<MiRNA> {
}
......@@ -106,11 +106,6 @@ public class MiRNAService implements IMiRNAService {
return views;
}
@Override
public MiRNAView createEmptyView() {
return miRNAViewFactory.create(null);
}
@Override
public MiRNA getByName(String name, DbSearchCriteria searchCriteria) {
if ("".equals(name)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment