- java.lang.Object
-
- org.jfree.svg.util.GradientPaintKey
-
public final class GradientPaintKey extends java.lang.Object
A wrapper for aGradientPaint
that can be used as the key for aMap
(including aHashMap
). This class is used internally bySVGGraphics2D
to track and re-use gradient definitions.GradientPaint
itself does not implement the equals() and hashCode() methods, so it doesn't make a good key for aMap
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.GradientPaint
paint
-
Constructor Summary
Constructors Constructor Description GradientPaintKey(java.awt.GradientPaint paint)
Creates a new instance based on the specifiedpaint
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Checks this instance for equality with an arbitrary object.java.awt.GradientPaint
getPaint()
Returns theGradientPaint
that was supplied to the constructor.int
hashCode()
Returns a hash code for this instance.
-
-
-
Method Detail
-
getPaint
public java.awt.GradientPaint getPaint()
Returns theGradientPaint
that was supplied to the constructor.- Returns:
- The
GradientPaint
(nevernull
).
-
equals
public boolean equals(java.lang.Object obj)
Checks this instance for equality with an arbitrary object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to test against (null
permitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code for this instance.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hash code.
-
-