The only entity "using" this class is the compiler which needs to know all the keys and values supported :-) 

> On Feb 19, 2014, at 9:03 PM, Max Qitian Chen <notifications@github.com> wrote:
> 
> In src/main/java/org/whdl/frontend/syntaxtree/EnumTypeValue.java:
> 
> > +	public EnumTypeValue(TypeValue typeOfEnums, Map<String, Value> enums) throws TypeMismatchException {
> > +		this.enumsType = typeOfEnums;
> > +		this.enums = new HashMap<String, Value>();
> > +		
> > +		for(Map.Entry<String, Value> e : enums.entrySet()) {
> > +			this.enums.put(e.getKey(), e.getValue());
> > +		}
> > +	}
> > +	
> > +	public boolean contains(String key) {
> > +		return enums.containsKey(key);
> > +	}
> > +	
> > +	public Value get(String key) {
> > +		return enums.get(key);
> > +	}
> I didn't want to expose the whole hashmap since then we have to worry about making it immutable or making a copy and what not. it also exposes too much of the object which I don't think is necessary. Someone using the class shouldn't have to care what the underlying representation is nor do they want it. Just my 2c.
> 
> —
> Reply to this email directly or view it on GitHub.