implementing a dictionary data structure in java