You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
725 B
52 lines
725 B
10 years ago
|
package mightypork.utils.eventbus.clients;
|
||
|
|
||
|
|
||
|
import java.util.Collection;
|
||
|
|
||
|
import mightypork.utils.interfaces.Enableable;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* List of clients, that can be used as a delegating client.
|
||
|
*
|
||
|
* @author Ondřej Hruška (MightyPork)
|
||
|
*/
|
||
|
public class DelegatingList extends ClientList implements DelegatingClient, Enableable {
|
||
|
|
||
|
private boolean enabled = true;
|
||
|
|
||
|
|
||
|
public DelegatingList(Object... clients)
|
||
|
{
|
||
|
super(clients);
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public Collection<?> getChildClients()
|
||
|
{
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public boolean doesDelegate()
|
||
|
{
|
||
|
return isEnabled();
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void setEnabled(boolean yes)
|
||
|
{
|
||
|
enabled = yes;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public boolean isEnabled()
|
||
|
{
|
||
|
return enabled;
|
||
|
}
|
||
|
}
|