Package org.jfree.chart
Class StrokeMap
java.lang.Object
org.jfree.chart.StrokeMap
- All Implemented Interfaces:
Serializable,Cloneable
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:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final longFor serialization.private MapStorage for the keys and values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Resets the map to empty.clone()Returns a clone of thisStrokeMap.booleancontainsKey(Comparable key) Returnstrueif the map contains the specified key, andfalseotherwise.booleanTests this map for equality with an arbitrary object.getStroke(Comparable key) Returns the stroke associated with the specified key, ornull.voidput(Comparable key, Stroke stroke) Adds a mapping between the specifiedkeyandstrokevalues.private voidreadObject(ObjectInputStream stream) Provides serialization support.private voidwriteObject(ObjectOutputStream stream) Provides serialization support.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDFor serialization.- See Also:
-
store
Storage for the keys and 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 (nullnot permitted).- Returns:
- The stroke, or
null. - Throws:
IllegalArgumentException- ifkeyisnull.
-
containsKey
Returnstrueif the map contains the specified key, andfalseotherwise.- Parameters:
key- the key.- Returns:
trueif the map contains the specified key, andfalseotherwise.
-
put
Adds a mapping between the specifiedkeyandstrokevalues.- Parameters:
key- the key (nullnot permitted).stroke- the stroke.
-
clear
public void clear()Resets the map to empty. -
equals
Tests this map for equality with an arbitrary object. -
clone
Returns a clone of thisStrokeMap.- Overrides:
clonein classObject- Returns:
- A clone of this instance.
- Throws:
CloneNotSupportedException- if any key is not cloneable.
-
writeObject
Provides serialization support.- Parameters:
stream- the output stream.- Throws:
IOException- if there is an I/O error.
-
readObject
Provides serialization support.- Parameters:
stream- the input stream.- Throws:
IOException- if there is an I/O error.ClassNotFoundException- if there is a classpath problem.
-