class StandardPieURLGenerator implements PieURLGenerator, Serializable {

    @Override
    public String generateURL(PieDataset dataset, Comparable key,
            int pieIndex) {
        String url = this.prefix;
        try {
            if (url.contains("?")) {
                url += "&amp;" + this.categoryParamName + "="
                        + URLEncoder.encode(key.toString(), "UTF-8");
            } else {
                url += "?" + this.categoryParamName + "="
                        + URLEncoder.encode(key.toString(), "UTF-8");
            }
            if (this.indexParamName != null) {
                url += "&amp;" + this.indexParamName + "="
                       + String.valueOf(pieIndex);
            }
        } catch (UnsupportedEncodingException ex) { // will not happen :)
            throw new RuntimeException(ex);
        }
        return url;
    }

    public  StandardPieURLGenerator();
    public  StandardPieURLGenerator(String prefix);
    public  StandardPieURLGenerator(String prefix, String categoryParamName);
    public  StandardPieURLGenerator(String prefix, String categoryParamName,
            String indexParamName);

}