@Test public void testUnregister() { testRegistration(); dt.remove("a"); assertFalse(dt.isRegistered("a")); assertFalse(dt.isResolved("a")); assertNull(dt.get("a")); assertTrue(dt.isRegistered("ab")); assertFalse(dt.isResolved("ab")); assertEquals("ab", dt.get("ab")); assertTrue(dt.isRegistered("b")); assertFalse(dt.isResolved("b")); assertEquals("b", dt.get("b")); assertTrue(dt.isRegistered("ac")); assertFalse(dt.isResolved("ac")); assertEquals("ac", dt.get("ac")); assertTrue(dt.isRegistered("c")); assertFalse(dt.isResolved("c")); assertEquals("c", dt.get("c")); }
public void unregister(Entry<K, T> entry) { if (entry.isResolved()) { unresolve(entry); } notifyUnregistered(entry); }
DependencyTree implements Iterable<DependencyTree.Entry<K, T>> { public void unregister(Entry<K, T> entry) { if (entry.isResolved()) { unresolve(entry); } notifyUnregistered(entry); } }
DependencyTree implements Iterable<DependencyTree.Entry<K, T>> { public void unregister(Entry<K, T> entry) { if (entry.isResolved()) { unresolve(entry); } notifyUnregistered(entry); } DependencyTree(); }
DependencyTree implements Iterable<DependencyTree.Entry<K, T>> { public void unregister(Entry<K, T> entry) { if (entry.isResolved()) { unresolve(entry); } notifyUnregistered(entry); } DependencyTree(); @Override Iterator<Entry<K, T>> iterator(); void add(K key, T object, K... requires); void add(K key, T object, Collection<K> requires); void add(K key, T object); void remove(K key); void unregister(Entry<K, T> entry); Entry<K, T> getEntry(K key); T get(K key); void resolve(Entry<K, T> entry); void unresolve(Entry<K, T> entry); boolean isRegistered(K key); boolean isResolved(K key); void setEventHandler(EventHandler<T> eventHandler); Collection<Entry<K, T>> getEntries(); List<Entry<K, T>> getPendingEntries(); List<T> getPendingObjects(); List<Entry<K, T>> getMissingRequirements(); List<Entry<K, T>> getResolvedEntries(); List<T> getResolvedObjects(); void clear(); }
DependencyTree implements Iterable<DependencyTree.Entry<K, T>> { public void unregister(Entry<K, T> entry) { if (entry.isResolved()) { unresolve(entry); } notifyUnregistered(entry); } DependencyTree(); @Override Iterator<Entry<K, T>> iterator(); void add(K key, T object, K... requires); void add(K key, T object, Collection<K> requires); void add(K key, T object); void remove(K key); void unregister(Entry<K, T> entry); Entry<K, T> getEntry(K key); T get(K key); void resolve(Entry<K, T> entry); void unresolve(Entry<K, T> entry); boolean isRegistered(K key); boolean isResolved(K key); void setEventHandler(EventHandler<T> eventHandler); Collection<Entry<K, T>> getEntries(); List<Entry<K, T>> getPendingEntries(); List<T> getPendingObjects(); List<Entry<K, T>> getMissingRequirements(); List<Entry<K, T>> getResolvedEntries(); List<T> getResolvedObjects(); void clear();  }