Package org.jfree.chart
Class StrokeMap
- java.lang.Object
-
- org.jfree.chart.StrokeMap
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class StrokeMap extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableA storage structure that mapsComparableinstances withStrokeinstances.
To support cloning and serialization, you should only use keys that are cloneable and serializable. Special handling for theStrokeinstances is included in this class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static longserialVersionUIDFor serialization.private java.util.MapstoreStorage for the keys and values.
-
Constructor Summary
Constructors Constructor Description StrokeMap()Creates a new (empty) map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Resets the map to empty.java.lang.Objectclone()Returns a clone of thisStrokeMap.booleancontainsKey(java.lang.Comparable key)Returnstrueif the map contains the specified key, andfalseotherwise.booleanequals(java.lang.Object obj)Tests this map for equality with an arbitrary object.java.awt.StrokegetStroke(java.lang.Comparable key)Returns the stroke associated with the specified key, ornull.voidput(java.lang.Comparable key, java.awt.Stroke stroke)Adds a mapping between the specifiedkeyandstrokevalues.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
store
private transient java.util.Map store
Storage for the keys and values.
-
-
Method Detail
-
getStroke
public java.awt.Stroke getStroke(java.lang.Comparable key)
Returns the stroke associated with the specified key, ornull.- Parameters:
key- the key (nullnot permitted).- Returns:
- The stroke, or
null. - Throws:
java.lang.IllegalArgumentException- ifkeyisnull.
-
containsKey
public boolean containsKey(java.lang.Comparable key)
Returnstrueif the map contains the specified key, andfalseotherwise.- Parameters:
key- the key.- Returns:
trueif the map contains the specified key, andfalseotherwise.
-
put
public void put(java.lang.Comparable key, java.awt.Stroke stroke)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
public boolean equals(java.lang.Object obj)
Tests this map for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of thisStrokeMap.- Overrides:
clonein classjava.lang.Object- Returns:
- A clone of this instance.
- Throws:
java.lang.CloneNotSupportedException- if any key is not cloneable.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-