public Object put(CompositeMap map, Map[] composited, Object key, Object value) { if (composited.length < 1) { throw new UnsupportedOperationException( "No composites to add elements to"); } Object result = map.get(key); if (result != null) { map.remove(key); } composited[composited.length - 1].put(key, value); return result; }
public void putAll(CompositeMap map, Map[] composited, Map mapToAdd) { for (Entry entry : (Set<Entry>) mapToAdd.entrySet()) { put(map, composited, entry.getKey(), entry.getValue()); } }
public void resolveCollision(CompositeMap composite, Map existing, Map added, Collection intersect) { existing.keySet().removeAll(intersect); }