org.jfree.graphics2d
Class LinearGradientPaintKey

java.lang.Object
  extended by org.jfree.graphics2d.LinearGradientPaintKey

public class LinearGradientPaintKey
extends Object

A wrapper for a LinearGradientPaint 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. LinearGradientPaint itself does not implement the equals() and hashCode() methods, so it doesn't make a good key for a Map.

Since:
1.9

Constructor Summary
LinearGradientPaintKey(LinearGradientPaint lgp)
          Creates a new instance.
 
Method Summary
 boolean equals(Object obj)
          Tests this instance for equality with an arbitrary object.
 LinearGradientPaint getPaint()
          Returns the LinearGradientPaint 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

LinearGradientPaintKey

public LinearGradientPaintKey(LinearGradientPaint lgp)
Creates a new instance.

Parameters:
lgp - the linear gradient paint (null not permitted).
Method Detail

getPaint

public LinearGradientPaint getPaint()
Returns the LinearGradientPaint that was supplied to the constructor.

Returns:
The LinearGradientPaint (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.


Copyright © 2015. All rights reserved.