org.jfree.graphics2d

## Class GradientPaintKey

- java.lang.Object
- - org.jfree.graphics2d.GradientPaintKey

-     public final class GradientPaintKey
      extends java.lang.Object

  A wrapper for a `GradientPaint` that can be used as the key for a `Map` (including a `HashMap`). This class is used internally by `SVGGraphics2D` 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 a `Map`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GradientPaintKey(java.awt.GradientPaint paint)` Creates a new instance based on the specified `paint`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Checks this instance for equality with an arbitrary object.
    `java.awt.GradientPaint` | `getPaint()` Returns the `GradientPaint` that was supplied to the constructor.
    `int` | `hashCode()` Returns a hash code for this instance.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GradientPaintKey

          public GradientPaintKey(java.awt.GradientPaint paint)

      Creates a new instance based on the specified `paint`.
      Parameters:
        `paint` - the paint (`null` not permitted).

  - ### Method Detail

    - #### getPaint

          public java.awt.GradientPaint getPaint()

      Returns the `GradientPaint` that was supplied to the constructor.
      Returns:
        The `GradientPaint` (never `null`).

    - #### equals

          public boolean equals(java.lang.Object obj)

      Checks this instance for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.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 class `java.lang.Object`
      Returns:
        A hash code.