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


public class IconCounterCounter
{
    private static Map ourMap = new HashMap();


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


    private static class Counter
    {
        int myCount;

        Counter ()
        {
            myCount = 0;
        }

        void incr ()
        {
            myCount++;
        }

        int getValue ()
        {
            return myCount;
        }
    }
}

