Package org.jfree.chart
Class StrokeMap
java.lang.Object
org.jfree.chart.StrokeMap
- All Implemented Interfaces:
Serializable
,Cloneable
public class StrokeMap extends Object implements Cloneable, Serializable
A storage structure that maps
To support cloning and serialization, you should only use keys that are cloneable and serializable. Special handling for the
Comparable
instances with
Stroke
instances.
To support cloning and serialization, you should only use keys that are cloneable and serializable. Special handling for the
Stroke
instances is included in this class.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description StrokeMap()
Creates a new (empty) map. -
Method Summary
Modifier and Type Method Description void
clear()
Resets the map to empty.Object
clone()
Returns a clone of thisStrokeMap
.boolean
containsKey(Comparable key)
Returnstrue
if the map contains the specified key, andfalse
otherwise.boolean
equals(Object obj)
Tests this map for equality with an arbitrary object.Stroke
getStroke(Comparable key)
Returns the stroke associated with the specified key, ornull
.void
put(Comparable key, Stroke stroke)
Adds a mapping between the specifiedkey
andstroke
values.
-
Constructor Details
-
StrokeMap
public StrokeMap()Creates a new (empty) map.
-
-
Method Details
-
getStroke
Returns the stroke associated with the specified key, ornull
.- Parameters:
key
- the key (null
not permitted).- Returns:
- The stroke, or
null
. - Throws:
IllegalArgumentException
- ifkey
isnull
.
-
containsKey
Returnstrue
if the map contains the specified key, andfalse
otherwise.- Parameters:
key
- the key.- Returns:
true
if the map contains the specified key, andfalse
otherwise.
-
put
Adds a mapping between the specifiedkey
andstroke
values.- Parameters:
key
- the key (null
not permitted).stroke
- the stroke.
-
clear
Resets the map to empty. -
equals
Tests this map for equality with an arbitrary object. -
clone
Returns a clone of thisStrokeMap
.- Overrides:
clone
in classObject
- Returns:
- A clone of this instance.
- Throws:
CloneNotSupportedException
- if any key is not cloneable.
-