18 package org.turro.plugin.contacts;
21 import java.util.TreeMap;
22 import org.turro.action.Contacts;
28 public class IContactTreeMap<C, V>
extends TreeMap<IContact, V> {
31 super(iContactNameComparator);
35 public V
get(Object key) {
36 return super.get(getRealKey(key));
41 return super.put(getRealKey(key), value);
45 return super.get(getRealKeyById(key));
49 return super.put(getRealKeyById(key), value);
53 public void putAll(Map<? extends IContact, ? extends V> map) {
54 throw new UnsupportedOperationException(
"Use putIContact instead");
57 private IContact getRealKey(Object key) {
60 if(ic.getId().equals(ickey.
getId())) {
64 return (IContact) key;
67 private IContact getRealKeyById(String key) {
68 for(IContact ic : keySet()) {
69 if(ic.getId().equals(key)) {
73 return Contacts.getContactById(key);