    001    package net.minecraft.src;
    002
    003    import java.util.Collection;
    004    import java.util.Iterator;
    005    import java.util.LinkedHashMap;
    006    import java.util.Map;
    007    import java.util.Set;
    008    import java.util.Map.Entry;
    009
    010    public class LowerStringMap implements Map
    011    {
    012        private final Map internalMap = new LinkedHashMap();
    013
    014        public int size()
    015        {
    016            return this.internalMap.size();
    017        }
    018
    019        public boolean isEmpty()
    020        {
    021            return this.internalMap.isEmpty();
    022        }
    023
    024        public boolean containsKey(Object par1Obj)
    025        {
    026            return this.internalMap.containsKey(par1Obj.toString().toLowerCase());
    027        }
    028
    029        public boolean containsValue(Object par1Obj)
    030        {
    031            return this.internalMap.containsKey(par1Obj);
    032        }
    033
    034        public Object get(Object par1Obj)
    035        {
    036            return this.internalMap.get(par1Obj.toString().toLowerCase());
    037        }
    038
    039        /**
    040         * a map already defines a general put
    041         */
    042        public Object putLower(String par1Str, Object par2Obj)
    043        {
    044            return this.internalMap.put(par1Str.toLowerCase(), par2Obj);
    045        }
    046
    047        public Object remove(Object par1Obj)
    048        {
    049            return this.internalMap.remove(par1Obj.toString().toLowerCase());
    050        }
    051
    052        public void putAll(Map par1Map)
    053        {
    054            Iterator var2 = par1Map.entrySet().iterator();
    055
    056            while (var2.hasNext())
    057            {
    058                Entry var3 = (Entry)var2.next();
    059                this.putLower((String)var3.getKey(), var3.getValue());
    060            }
    061        }
    062
    063        public void clear()
    064        {
    065            this.internalMap.clear();
    066        }
    067
    068        public Set keySet()
    069        {
    070            return this.internalMap.keySet();
    071        }
    072
    073        public Collection values()
    074        {
    075            return this.internalMap.values();
    076        }
    077
    078        public Set entrySet()
    079        {
    080            return this.internalMap.entrySet();
    081        }
    082
    083        public Object put(Object par1Obj, Object par2Obj)
    084        {
    085            return this.putLower((String)par1Obj, par2Obj);
    086        }
    087    }