/*
* Copyright (C) 2004 Roman Krylov
* rkrylov@mail.ru
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.JWrapper;
public abstract class Signal// implements Func_t
{
protected java.util.List slots
= new java.util.LinkedList();
public Signal()
{ }
public int connect(Func_t slot)
{
//System.out.println("slot "+slot.hashCode()+" to "+this.hashCode()+" added.");//testing
slots.add(slot);
return slots.size() -1;
}
public void disconnect(Func_t slot)
{ slots.remove(slot); }
public void disconnect(int slot_index)
{ slots.remove(slot_index); }
public void disconnect_all()
{ slots.clear(); }
public int size()
{ return slots.size(); }
}
|