class EventFilterChain implements EventSink {

	public synchronized void remove_filter(EventFilter f) {
		Ensure.not_null(f);
		Ensure.is_true(m_filters.contains(f));
		
		int idx = m_filters.indexOf(f);
		EventFilter prev = null;
		if (idx != (m_filters.size() - 1)) {
			prev = m_filters.get(idx + 1);
		}
		
		if (prev != null) {
			prev.unlock(m_filters);
			prev.connect(null);
			prev.connect(f.connected());
			prev.lock(m_filters);
		}
		
		f.unlock(m_filters);
		f.connect(null);
		m_filters.remove(f);
	}

	public  EventFilterChain(EventSink sink);

}