Package org.jfree.chart.urls
Class CustomPieURLGenerator
java.lang.Object
org.jfree.chart.urls.CustomPieURLGenerator
- All Implemented Interfaces:
Serializable,Cloneable,PieURLGenerator,PublicCloneable
public class CustomPieURLGenerator
extends Object
implements PieURLGenerator, Cloneable, PublicCloneable, Serializable
A custom URL generator for pie charts.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newCustomPieURLGeneratorinstance, initially empty. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a map containing(key, URL)mappings where eachkeyis an instance ofComparable(corresponding to the key for an item in a pie dataset) and eachURLis aStringrepresenting a URL fragment.clone()Returns a clone of the generator.booleanTests if this object is equal to another.generateURL(PieDataset dataset, Comparable key, int pieIndex) Generates a URL fragment.intReturns the number of URL maps stored by the renderer.getURL(Comparable key, int mapIndex) Returns the URL for a section in the specified map.intgetURLCount(int list) Returns the number of URLs in a given map (specified by its position in the map list).
-
Constructor Details
-
CustomPieURLGenerator
public CustomPieURLGenerator()Creates a newCustomPieURLGeneratorinstance, initially empty. CalladdURLs(Map)to specify the URL fragments to be used.
-
-
Method Details
-
generateURL
Generates a URL fragment.- Specified by:
generateURLin interfacePieURLGenerator- Parameters:
dataset- the dataset (ignored).key- the item key.pieIndex- the pie index.- Returns:
- A string containing the generated URL.
- See Also:
-
getListCount
Returns the number of URL maps stored by the renderer.- Returns:
- The list count.
- See Also:
-
getURLCount
Returns the number of URLs in a given map (specified by its position in the map list).- Parameters:
list- the list index (zero based).- Returns:
- The URL count.
- See Also:
-
getURL
Returns the URL for a section in the specified map.- Parameters:
key- the key.mapIndex- the map index.- Returns:
- The URL.
-
addURLs
Adds a map containing(key, URL)mappings where eachkeyis an instance ofComparable(corresponding to the key for an item in a pie dataset) and eachURLis aStringrepresenting a URL fragment.
The map is appended to an internal list...you can add multiple maps if you are working with, say, aMultiplePiePlot.- Parameters:
urlMap- the URLs (nullpermitted).
-
equals
Tests if this object is equal to another. -
clone
Returns a clone of the generator.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if cloning is not supported.
-