import java.util.HashMap;
import java.awt.Image;

public class IconCounterCounter
{
    public static int getCount(Image im)
    {
	Object o;
	if ((o = ourMap.get(im)) == null) {
	    ourMap.put(im, o = new Counter());
	}
	else {
	    ((Counter) o).incr();
	}
	return ((Counter) o).getValue();
    }

    private static HashMap ourMap = new HashMap();

    private static class Counter
    {
	Counter()
	{
	    myCount = 0;
	}

	void incr()
	{
	    myCount++;
	}

	int getValue()
	{
	    return myCount;
	}

	int myCount;
    }
}


