2.17.2: 2011-06-17

net.sf.basedb.clients.web.servlet
Class ExperimentExplorerPlotServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by net.sf.basedb.clients.web.servlet.ExperimentExplorerPlotServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class ExperimentExplorerPlotServlet
extends HttpServlet

Plot servlet for generating plots from experiment explorer.

Version:
2.14
Author:
Nicklas
See Also:
Serialized Form
Last modified
$Date: 2010-04-20 10:02:16 +0200 (Tue, 20 Apr 2010) $

Nested Class Summary
static class ExperimentExplorerPlotServlet.ColumnKey
          Uses as a column key in the plots.
 
Field Summary
private  String defaultFormat
           
private  int defaultHeight
           
private  int defaultWidth
           
private  int maxHeight
           
private  int maxWidth
           
private static long serialVersionUID
           
 
Constructor Summary
ExperimentExplorerPlotServlet()
           
 
Method Summary
 BoxAndWhiskerItem calculateBoxAndWhiskerStatistics(List<Float> values)
          Creates a box-and-whisker data holder for the given list of values.
 void doGet(HttpServletRequest request, HttpServletResponse response)
           
 float getPercentile(List<? extends Number> values, int percentile)
          Calculates the percentile values from a sorted list of values.
 void init()
           
private  void saveImageToFile(DbControl dc, BufferedImage image, String path, String format, boolean overwrite)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

maxWidth

private int maxWidth

maxHeight

private int maxHeight

defaultWidth

private int defaultWidth

defaultHeight

private int defaultHeight

defaultFormat

private String defaultFormat
Constructor Detail

ExperimentExplorerPlotServlet

public ExperimentExplorerPlotServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class GenericServlet
Throws:
ServletException

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws IOException,
                  ServletException
Overrides:
doGet in class HttpServlet
Throws:
IOException
ServletException

saveImageToFile

private void saveImageToFile(DbControl dc,
                             BufferedImage image,
                             String path,
                             String format,
                             boolean overwrite)
                      throws IOException
Throws:
IOException

calculateBoxAndWhiskerStatistics

public BoxAndWhiskerItem calculateBoxAndWhiskerStatistics(List<Float> values)
Creates a box-and-whisker data holder for the given list of values. The data holder will be populated with the median and the 5th, 25th, 75th and 95th percentile values as follows: The mean and outlier values are currently not calculated (may change in the future).

Parameters:
values - The list of values which must be sorted in ascending order
Returns:
A BoxAndWhiskerItem object

getPercentile

public float getPercentile(List<? extends Number> values,
                           int percentile)
Calculates the percentile values from a sorted list of values. If the percentile falls between two elements in the list the average of the two nearest elements are used.

Parameters:
values - The values which must be sorted
percentile - The percentile, a value between 0 and 100
Returns:
The percentile value, or Float.NaN if it could not be calculated

2.17.2: 2011-06-17