1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db.common.procedure.wrapper;
\r
14 import org.simantics.db.common.procedure.single.SingleSetListener;
\r
15 import org.simantics.db.procedure.SetListener;
\r
17 public class SetListenerToSingleSetListener<T> extends SingleSetListener<T> {
\r
19 final private SetListener<T> listener;
\r
21 public SetListenerToSingleSetListener(SetListener<T> listener) {
\r
22 this.listener = listener;
\r
25 public void add(T result) {
\r
26 listener.add(result);
\r
29 public void remove(T result) {
\r
30 listener.remove(result);
\r
34 public void exception(Throwable t) {
\r
35 listener.exception(t);
\r
39 public boolean isDisposed() {
\r
40 return listener.isDisposed();
\r
44 public int hashCode() {
\r
45 return listener.hashCode();
\r
49 public boolean equals(Object object) {
\r
52 else if (object == null)
\r
54 else if (SetListenerToSingleSetListener.class != object.getClass())
\r
56 SetListenerToSingleSetListener<?> r = (SetListenerToSingleSetListener<?>)object;
\r
57 return r.listener.equals(listener);
\r