@Test public void testGenerateURL() { TimeSeriesURLGenerator g = new TimeSeriesURLGenerator(); DefaultXYDataset dataset = new DefaultXYDataset(); dataset.addSeries("Series '1'", new double[][] {{1.0, 2.0}, {3.0, 4.0}}); String s = g.generateURL(dataset, 0, 0); assertTrue(s.startsWith("index.html?series=Series+%271%27&amp;item=")); }
@Override public String generateURL(XYDataset dataset, int series, int item) { String result = this.prefix; boolean firstParameter = result.indexOf("?") == -1; Comparable seriesKey = dataset.getSeriesKey(series); if (seriesKey != null) { result += firstParameter ? "?" : "&amp;"; result += this.seriesParameterName + "=" + URLUtilities.encode( seriesKey.toString(), "UTF-8"); firstParameter = false; } long x = (long) dataset.getXValue(series, item); String xValue = this.dateFormat.format(new Date(x)); result += firstParameter ? "?" : "&amp;"; result += this.itemParameterName + "=" + URLUtilities.encode(xValue, "UTF-8"); return result; }
TimeSeriesURLGenerator implements XYURLGenerator, Serializable { @Override public String generateURL(XYDataset dataset, int series, int item) { String result = this.prefix; boolean firstParameter = result.indexOf("?") == -1; Comparable seriesKey = dataset.getSeriesKey(series); if (seriesKey != null) { result += firstParameter ? "?" : "&amp;"; result += this.seriesParameterName + "=" + URLUtilities.encode( seriesKey.toString(), "UTF-8"); firstParameter = false; } long x = (long) dataset.getXValue(series, item); String xValue = this.dateFormat.format(new Date(x)); result += firstParameter ? "?" : "&amp;"; result += this.itemParameterName + "=" + URLUtilities.encode(xValue, "UTF-8"); return result; } }
TimeSeriesURLGenerator implements XYURLGenerator, Serializable { @Override public String generateURL(XYDataset dataset, int series, int item) { String result = this.prefix; boolean firstParameter = result.indexOf("?") == -1; Comparable seriesKey = dataset.getSeriesKey(series); if (seriesKey != null) { result += firstParameter ? "?" : "&amp;"; result += this.seriesParameterName + "=" + URLUtilities.encode( seriesKey.toString(), "UTF-8"); firstParameter = false; } long x = (long) dataset.getXValue(series, item); String xValue = this.dateFormat.format(new Date(x)); result += firstParameter ? "?" : "&amp;"; result += this.itemParameterName + "=" + URLUtilities.encode(xValue, "UTF-8"); return result; } TimeSeriesURLGenerator();  TimeSeriesURLGenerator(DateFormat dateFormat, String prefix,
            String seriesParameterName, String itemParameterName); }
TimeSeriesURLGenerator implements XYURLGenerator, Serializable { @Override public String generateURL(XYDataset dataset, int series, int item) { String result = this.prefix; boolean firstParameter = result.indexOf("?") == -1; Comparable seriesKey = dataset.getSeriesKey(series); if (seriesKey != null) { result += firstParameter ? "?" : "&amp;"; result += this.seriesParameterName + "=" + URLUtilities.encode( seriesKey.toString(), "UTF-8"); firstParameter = false; } long x = (long) dataset.getXValue(series, item); String xValue = this.dateFormat.format(new Date(x)); result += firstParameter ? "?" : "&amp;"; result += this.itemParameterName + "=" + URLUtilities.encode(xValue, "UTF-8"); return result; } TimeSeriesURLGenerator();  TimeSeriesURLGenerator(DateFormat dateFormat, String prefix,
            String seriesParameterName, String itemParameterName); DateFormat getDateFormat(); String getPrefix(); String getSeriesParameterName(); String getItemParameterName(); @Override String generateURL(XYDataset dataset, int series, int item); @Override boolean equals(Object obj); }
TimeSeriesURLGenerator implements XYURLGenerator, Serializable { @Override public String generateURL(XYDataset dataset, int series, int item) { String result = this.prefix; boolean firstParameter = result.indexOf("?") == -1; Comparable seriesKey = dataset.getSeriesKey(series); if (seriesKey != null) { result += firstParameter ? "?" : "&amp;"; result += this.seriesParameterName + "=" + URLUtilities.encode( seriesKey.toString(), "UTF-8"); firstParameter = false; } long x = (long) dataset.getXValue(series, item); String xValue = this.dateFormat.format(new Date(x)); result += firstParameter ? "?" : "&amp;"; result += this.itemParameterName + "=" + URLUtilities.encode(xValue, "UTF-8"); return result; } TimeSeriesURLGenerator();  TimeSeriesURLGenerator(DateFormat dateFormat, String prefix,
            String seriesParameterName, String itemParameterName); DateFormat getDateFormat(); String getPrefix(); String getSeriesParameterName(); String getItemParameterName(); @Override String generateURL(XYDataset dataset, int series, int item); @Override boolean equals(Object obj);  }