Skip to content

Instantly share code, notes, and snippets.

@azyobuzin
Forked from anonymous/Notificator.java
Created December 17, 2012 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azyobuzin/4317867 to your computer and use it in GitHub Desktop.
Save azyobuzin/4317867 to your computer and use it in GitHub Desktop.
package net.azyobuzi.saostar.util;
import java.util.HashSet;
public class Notificator
{
private HashSet<Action> handlers = new HashSet<Action>();
public void add(Action handler)
{
handlers.add(handler);
}
public void remove(Action handler)
{
handlers.remove(handler);
}
public void raise()
{
for (Action handler : handlers)
handler.invoke();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment