class TimeSeriesURLGenerator implements XYURLGenerator, Serializable {

    @Override
    public String generateURL(XYDataset dataset, int series, int item) {
        String result = this.prefix;
        try {
            boolean firstParameter = !result.contains("?");
            Comparable seriesKey = dataset.getSeriesKey(series);
            if (seriesKey != null) {
                result += firstParameter ? "?" : "&amp;";
                result += this.seriesParamName + "=" + URLEncoder.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.itemParamName + "=" + URLEncoder.encode(xValue,
                    "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
        return result;
    }

    public  TimeSeriesURLGenerator();
    public  TimeSeriesURLGenerator(DateFormat dateFormat, String prefix,
            String seriesParamName, String itemParamName);

}