public class PaintMap extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
Comparable instances with
Paint instances.
Paint
instances is included in this class.| Constructor and Description |
|---|
PaintMap()
Creates a new (empty) map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Resets the map to empty.
|
java.lang.Object |
clone()
Returns a clone of this
PaintMap. |
boolean |
containsKey(java.lang.Comparable key)
Returns
true if the map contains the specified key, and
false otherwise. |
boolean |
equals(java.lang.Object obj)
Tests this map for equality with an arbitrary object.
|
java.awt.Paint |
getPaint(java.lang.Comparable key)
Returns the paint associated with the specified key, or
null. |
void |
put(java.lang.Comparable key,
java.awt.Paint paint)
Adds a mapping between the specified
key and
paint values. |
public PaintMap()
public java.awt.Paint getPaint(java.lang.Comparable key)
null.key - the key (null not permitted).null.java.lang.IllegalArgumentException - if key is
null.public boolean containsKey(java.lang.Comparable key)
true if the map contains the specified key, and
false otherwise.key - the key.true if the map contains the specified key, and
false otherwise.public void put(java.lang.Comparable key, java.awt.Paint paint)
key and
paint values.key - the key (null not permitted).paint - the paint.java.lang.IllegalArgumentException - if key is
null.public void clear()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public java.lang.Object clone() throws java.lang.CloneNotSupportedException
PaintMap.clone in class java.lang.Objectjava.lang.CloneNotSupportedException - if any key is not cloneable.