public SortedMap<String, T> getAsMap() { SortedMap<String, T> map = new TreeMap<String, T>(); for (T o : getStore()) { map.put(namer.determineName(o), o); } return map; }
/** * Subclasses that can guarantee that the backing store enforces name uniqueness should override * this to simply call super.add(T) (avoiding an unnecessary lookup) */ public boolean add(T o) { if (!hasWithName(namer.determineName(o))) { return super.add(o); } else { handleAttemptToAddItemWithNonUniqueName(o); return false; } }
protected T findByNameWithoutRules(String name) { for (T o : getStore()) { if (name.equals(namer.determineName(o))) { return o; } } return null; }