A custom URL generator.
| Method from org.jfree.chart.urls.CustomXYURLGenerator Detail: |
public void addURLSeries(List urls) {
List listToAdd = null;
if (urls != null) {
listToAdd = new java.util.ArrayList(urls);
}
this.urlSeries.add(listToAdd);
}
|
public Object clone() throws CloneNotSupportedException {
CustomXYURLGenerator clone = (CustomXYURLGenerator) super.clone();
clone.urlSeries = new java.util.ArrayList(this.urlSeries);
return clone;
}
Returns a new generator that is a copy of, and independent from, this
generator. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof CustomXYURLGenerator)) {
return false;
}
CustomXYURLGenerator that = (CustomXYURLGenerator) obj;
int listCount = getListCount();
if (listCount != that.getListCount()) {
return false;
}
for (int series = 0; series < listCount; series++) {
int urlCount = getURLCount(series);
if (urlCount != that.getURLCount(series)) {
return false;
}
for (int item = 0; item < urlCount; item++) {
String u1 = getURL(series, item);
String u2 = that.getURL(series, item);
if (u1 != null) {
if (!u1.equals(u2)) {
return false;
}
}
else {
if (u2 != null) {
return false;
}
}
}
}
return true;
}
Tests this generator for equality with an arbitrary object. |
public String generateURL(XYDataset dataset,
int series,
int item) {
return getURL(series, item);
}
|
public int getListCount() {
return this.urlSeries.size();
}
Returns the number of URL lists stored by the renderer. |
public String getURL(int series,
int item) {
String result = null;
if (series < getListCount()) {
List urls = (List) this.urlSeries.get(series);
if (urls != null) {
if (item < urls.size()) {
result = (String) urls.get(item);
}
}
}
return result;
}
Returns the URL for an item. |
public int getURLCount(int list) {
int result = 0;
List urls = (List) this.urlSeries.get(list);
if (urls != null) {
result = urls.size();
}
return result;
}
Returns the number of URLs in a given list. |