1 11 package org.eclipse.ui.internal.themes; 12 13 import java.util.Collections ; 14 import java.util.HashSet ; 15 import java.util.Map ; 16 import java.util.Set ; 17 18 21 public class CascadingMap { 22 23 private Map base, override; 24 25 29 public CascadingMap(Map base, Map override) { 30 this.base = base; 31 this.override = override; 32 } 33 34 39 public Set keySet() { 40 Set keySet = new HashSet (base.keySet()); 41 keySet.addAll(override.keySet()); 42 return Collections.unmodifiableSet(keySet); 43 } 44 45 51 public Object get(Object key) { 52 if (override.containsKey(key)) { 53 return override.get(key); 54 } 55 return base.get(key); 56 } 57 } 58 | Popular Tags |