Class ColorPool

java.lang.Object
org.jbox2d.testbed.pooling.ColorPool

public class ColorPool extends java.lang.Object
Sun just HAD to make Color immutable, so now I have to make another stupid pool and now I'm all hot and bothered. Also, this pool isn't thread safe!
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private java.util.HashMap<ColorKey,java.awt.Color>
     
    private final ColorKey
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    java.awt.Color
    getColor(float r, float g, float b)
     
    java.awt.Color
    getColor(float r, float g, float b, float alpha)
     

    Methods inherited from class java.lang.Object

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

    • colorMap

      private java.util.HashMap<ColorKey,java.awt.Color> colorMap
    • queryKey

      private final ColorKey queryKey
  • Constructor Details

    • ColorPool

      public ColorPool()
  • Method Details

    • getColor

      public java.awt.Color getColor(float r, float g, float b, float alpha)
    • getColor

      public java.awt.Color getColor(float r, float g, float b)