View Javadoc

1   /*
2    * @(#) Histogram.java Oct 19, 2003
3    * 
4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
5    * the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
9    */
10  package nl.tudelft.simulation.dsol.statistics.charts;
11  
12  import nl.tudelft.simulation.dsol.context.ContextUtil;
13  import nl.tudelft.simulation.dsol.simulators.SimulatorInterface;
14  
15  /***
16   * The Histogram extends the Histogram and links this it to the dsol framework
17   * <br>
18   * (c) copyright 2003 <a href="http://www.simulation.tudelft.nl">Delft
19   * University of Technology </a>, the Netherlands. <br>
20   * See for project information <a href="http://www.simulation.tudelft.nl">
21   * www.simulation.tudelft.nl </a> <br>
22   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
23   * License (GPL) </a>, no warranty <br>
24   * 
25   * @version 1.0 18.08.2003 <br>
26   * @author <a href="http://www.simulation.tudelft.nl/people/jacobs.html">Peter
27   *         Jacobs </a>
28   */
29  public class Histogram extends
30  		nl.tudelft.simulation.jstats.charts.histogram.Histogram
31  {
32  
33  	/***
34  	 * constructs a new Histogram
35  	 * 
36  	 * @param simulator the simulator
37  	 * @param title the title of the plot
38  	 * @param domain the domain of the plot
39  	 * @param range the range of the plot
40  	 * @param numberofBins the number of bins in this plot
41  	 */
42  	public Histogram(final SimulatorInterface simulator, final String title,
43  			final double[] domain, final double[] range, final int numberofBins)
44  	{
45  		super(title, domain, range, numberofBins);
46  		ContextUtil.bindToContext(simulator, this);
47  	}
48  
49  	/***
50  	 * constructs a new Histogram
51  	 * 
52  	 * @param simulator the simulator
53  	 * @param title the title
54  	 * @param domain the domain
55  	 * @param numberofBins the number of bins
56  	 */
57  	public Histogram(final SimulatorInterface simulator, final String title,
58  			final double[] domain, final int numberofBins)
59  	{
60  		super(title, domain, numberofBins);
61  		ContextUtil.bindToContext(simulator, this);
62  	}
63  
64  	/***
65  	 * @see java.lang.Object#toString()
66  	 */
67  	public String toString()
68  	{
69  		return super.getChart().getTitle().getText();
70  	}
71  }