/** * Generates a URL fragment. * * @param dataset the dataset (ignored). * @param key the item key. * @param pieIndex the pie index. * * @return A string containing the generated URL. * * @see #getURL(Comparable, int) */ @Override public String generateURL(PieDataset dataset, Comparable key, int pieIndex) { return getURL(key, pieIndex); }
if (getListCount() != generator.getListCount()) { return false; for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; for (Iterator i = keySet.iterator(); i.hasNext();) { key = (String) i.next(); if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false;
/** * Returns a clone of the generator. * * @return A clone. * * @throws CloneNotSupportedException if cloning is not supported. */ @Override public Object clone() throws CloneNotSupportedException { CustomPieURLGenerator urlGen = new CustomPieURLGenerator(); Map map; Map newMap; String key; for (Iterator i = this.urls.iterator(); i.hasNext();) { map = (Map) i.next(); newMap = new HashMap(); for (Iterator j = map.keySet().iterator(); j.hasNext();) { key = (String) j.next(); newMap.put(key, map.get(key)); } urlGen.addURLs(newMap); } return urlGen; }
/** * Returns the URL for a section in the specified map. * * @param key the key. * @param mapIndex the map index. * * @return The URL. */ public String getURL(Comparable key, int mapIndex) { String result = null; if (mapIndex < getListCount()) { Map urlMap = (Map) this.urls.get(mapIndex); if (urlMap != null) { result = (String) urlMap.get(key); } } return result; }
if (getListCount() != generator.getListCount()) { return false; for (int pieItem = 0; pieItem < getListCount(); pieItem++) { if (getURLCount(pieItem) != generator.getURLCount(pieItem)) { return false; for (Iterator i = keySet.iterator(); i.hasNext();) { key = (String) i.next(); if (!getURL(key, pieItem).equals( generator.getURL(key, pieItem))) { return false;
/** * Returns a clone of the generator. * * @return A clone. * * @throws CloneNotSupportedException if cloning is not supported. */ public Object clone() throws CloneNotSupportedException { CustomPieURLGenerator urlGen = new CustomPieURLGenerator(); Map map; Map newMap; String key; for (Iterator i = this.urls.iterator(); i.hasNext();) { map = (Map) i.next(); newMap = new HashMap(); for (Iterator j = map.keySet().iterator(); j.hasNext();) { key = (String) j.next(); newMap.put(key, map.get(key)); } urlGen.addURLs(newMap); newMap = null; } return urlGen; }
/** * Returns the URL for a section in the specified map. * * @param key the key. * @param mapIndex the map index. * * @return The URL. */ public String getURL(Comparable key, int mapIndex) { String result = null; if (mapIndex < getListCount()) { Map urlMap = (Map) this.urls.get(mapIndex); if (urlMap != null) { result = (String) urlMap.get(key); } } return result; }
/** * Generates a URL fragment. * * @param dataset the dataset (ignored). * @param key the item key. * @param pieIndex the pie index. * * @return A string containing the generated URL. * * @see #getURL(Comparable, int) */ public String generateURL(PieDataset dataset, Comparable key, int pieIndex) { return getURL(key, pieIndex); }