org.vizzini.ui
Class ColorCache

java.lang.Object
  extended by org.vizzini.ui.ColorCache

public class ColorCache
extends Object

Provides a cache for Color objects. Colors should be obtained using the get() method; subsequent calls will not create a new color object for the same coordinates, rather simply return the previously created one. Note that color objects are immutable and thus can be reused.

Since:
v0.2
Version:
v0.3
Author:
Jeffrey M. Thompson

Constructor Summary
ColorCache()
           
 
Method Summary
 void clear()
          Clear the cache.
 Color get(int r, int g, int b)
          Return a color for the given coordinates.
 Color get(int r, int g, int b, int a)
          Return a color for the given coordinates.
 int size()
          Return the number of Color objects cached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorCache

public ColorCache()
Method Detail

clear

public void clear()
Clear the cache.

Since:
v0.2

get

public Color get(int r,
                 int g,
                 int b)
Return a color for the given coordinates.

Since:
v0.2

get

public Color get(int r,
                 int g,
                 int b,
                 int a)
Return a color for the given coordinates.

Since:
v0.2

size

public int size()
Return the number of Color objects cached.

Since:
v0.2


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02