Class RadialGradientPaintKey

java.lang.Object
com.orsonpdf.util.RadialGradientPaintKey

public class RadialGradientPaintKey extends Object
A wrapper for a RadialGradientPaint that can be used as the key for a HashMap. This class is used internally by PDFGraphics2D to track and re-use gradient definitions. RadialGradientPaint itself does not implement the equals() and hashCode() methods, so it doesn't make a good key for a Map.
  • Field Details

  • Constructor Details

    • RadialGradientPaintKey

      public RadialGradientPaintKey(RadialGradientPaint rgp)
      Creates a new key instance.
      Parameters:
      rgp - the radial gradient paint (null not permitted).
  • Method Details

    • getPaint

      public RadialGradientPaint getPaint()
      Returns the RadialGradientPaint that was supplied to the constructor.
      Returns:
      The RadialGradientPaint (never null).
    • equals

      public boolean equals(Object obj)
      Tests this instance for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to test (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Returns a hash code for this instance.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code.