Package org.jfree.chart
Class PaintMap
java.lang.Object
org.jfree.chart.PaintMap
- 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
Paint
instances.
To support cloning and serialization, you should only use keys that are cloneable and serializable. Special handling for the
Paint
instances is included in this class.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final long
For serialization.private Map
Storage for the keys and values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Resets the map to empty.clone()
Returns a clone of thisPaintMap
.boolean
containsKey
(Comparable key) Returnstrue
if the map contains the specified key, andfalse
otherwise.boolean
Tests this map for equality with an arbitrary object.getPaint
(Comparable key) Returns the paint associated with the specified key, ornull
.void
put
(Comparable key, Paint paint) Adds a mapping between the specifiedkey
andPaint
values.private void
readObject
(ObjectInputStream stream) Provides serialization support.private void
writeObject
(ObjectOutputStream stream) Provides serialization support.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDFor serialization.- See Also:
-
store
Storage for the keys and values.
-
-
Constructor Details
-
PaintMap
public PaintMap()Creates a new (empty) map.
-
-
Method Details
-
getPaint
Returns the paint associated with the specified key, ornull
.- Parameters:
key
- the key (null
not permitted).- Returns:
- The paint, 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
andPaint
values.- Parameters:
key
- the key (null
not permitted).paint
- the paint.- Throws:
IllegalArgumentException
- ifkey
isnull
.
-
clear
public void clear()Resets the map to empty. -
equals
Tests this map for equality with an arbitrary object. -
clone
Returns a clone of thisPaintMap
.- Overrides:
clone
in 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.
-