Skip to content
Snippets Groups Projects
Commit 638ec61c authored by pompert's avatar pompert
Browse files

701

Additions:
- Exception handling using PlotterDataAccessExceptions
Mods:
- Constraints now a String[] instead of String to support multiple variables to be passed to data access layer
parent 819dfe6c
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ import java.util.HashMap;
import java.util.HashSet;
import nl.astron.lofar.sas.plotter.IPlotDataAccess;
import nl.astron.lofar.sas.plotter.PlotConstants;
import nl.astron.lofar.sas.plotter.exceptions.PlotterException;
import nl.astron.lofar.sas.plotter.exceptions.PlotterDataAccessException;
/**
* @created 19-04-2006, 11:00
......@@ -34,13 +34,13 @@ public class PlotDataAccessTestImpl implements IPlotDataAccess{
}
/**
* @param constraint
* @param constraints
*
*/
public HashMap retrieveData(String constraint) throws PlotterException{
public HashMap retrieveData(String[] constraints) throws PlotterDataAccessException{
//create the hashmap to be returned
HashMap<String,Object> data = new HashMap<String,Object>();
if(constraint.equalsIgnoreCase("line")){
if(constraints[0].equalsIgnoreCase("line")){
String plotTitle = "Testset LOFAR Plotter | XYLine";
data.put(PlotConstants.DATASET_NAME,plotTitle);
......@@ -109,7 +109,7 @@ public class PlotDataAccessTestImpl implements IPlotDataAccess{
values.add(aLine2);
data.put(PlotConstants.DATASET_VALUES,values);
}else if (constraint.equalsIgnoreCase("grid")){
}else if (constraints[0].equalsIgnoreCase("grid")){
String plotTitle = "Testset LOFAR Plotter | Grid";
data.put(PlotConstants.DATASET_NAME,plotTitle);
......@@ -186,4 +186,4 @@ public class PlotDataAccessTestImpl implements IPlotDataAccess{
}
return data;
}
}
\ No newline at end of file
}
......@@ -13,7 +13,7 @@ import java.util.HashMap;
import java.util.HashSet;
import nl.astron.lofar.sas.plotter.IPlotDataAccess;
import nl.astron.lofar.sas.plotter.PlotConstants;
import nl.astron.lofar.sas.plotter.exceptions.PlotterException;
import nl.astron.lofar.sas.plotter.exceptions.PlotterDataAccessException;
/**
* @created 19-04-2006, 11:00
......@@ -34,13 +34,13 @@ public class PlotDataAccessTestImpl implements IPlotDataAccess{
}
/**
* @param constraint
* @param constraints
*
*/
public HashMap retrieveData(String constraint) throws PlotterException{
public HashMap retrieveData(String[] constraints) throws PlotterDataAccessException{
//create the hashmap to be returned
HashMap<String,Object> data = new HashMap<String,Object>();
if(constraint.equalsIgnoreCase("line")){
if(constraints[0].equalsIgnoreCase("line")){
String plotTitle = "Testset LOFAR Plotter | XYLine";
data.put(PlotConstants.DATASET_NAME,plotTitle);
......@@ -109,7 +109,7 @@ public class PlotDataAccessTestImpl implements IPlotDataAccess{
values.add(aLine2);
data.put(PlotConstants.DATASET_VALUES,values);
}else if (constraint.equalsIgnoreCase("grid")){
}else if (constraints[0].equalsIgnoreCase("grid")){
String plotTitle = "Testset LOFAR Plotter | Grid";
data.put(PlotConstants.DATASET_NAME,plotTitle);
......@@ -186,4 +186,4 @@ public class PlotDataAccessTestImpl implements IPlotDataAccess{
}
return data;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment