Class ColorModelPatch<T extends ColorModel>

java.lang.Object
org.apache.sis.internal.coverage.j2d.ColorModelPatch<T>

@Workaround(library="JDK", version="8") final class ColorModelPatch<T extends ColorModel> extends Object
Workaround for broken ColorModel.equals(Object) in Java 8 and before. This workaround will be removed after upgrade to Java 9.
Version:
1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final T
    The color model to share.
  • Constructor Summary

    Constructors
    Constructor
    Description
    For internal use only.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static boolean
    Returns true if the given color models are equal.
    boolean
    equals(Object object)
    For internal use only.
    int
    For internal use only.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • cm

      final T extends ColorModel cm
      The color model to share.
  • Constructor Details

    • ColorModelPatch

      ColorModelPatch(T cm)
      For internal use only.
  • Method Details

    • equals

      private static boolean equals(ColorModel cm1, ColorModel cm2)
      Returns true if the given color models are equal. The ColorModel class defines an equals method, but as of Java 6 that method does not compare every attributes. For example, it does not compare the color space and the transfer type, so we have to compare them here.
      Parameters:
      cm1 - the first color model.
      cm2 - the second color model.
      Returns:
      true if the two color models are equal.
    • equals

      public boolean equals(Object object)
      For internal use only.
      Overrides:
      equals in class Object
      Parameters:
      object - object The object to compare to.
      Returns:
      true if both object are equal.
    • hashCode

      public int hashCode()
      For internal use only.
      Overrides:
      hashCode in class Object