Back to project page Spidermine.
The source code is released under:
Copyright ? 2014 PEMapModder This software is open-source and everyone is welcome to share redistributions or modifications, as long as it is clearly specified that this project's original source is ...
If you think the Android project Spidermine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pemapmodder.spidermine.managers; //from w w w . java2 s. c o m import pemapmodder.spidermine.SpiderServer; import pemapmodder.spidermine.events.Event; public class EventManager implements Manager<Event, String>{ protected Event[] events; public SpiderServer server; @Override public Event get(String id){ for(int i=0; i<events.length; i++){ if(events[i].getClass().getName().equals(id)) return events[i]; } return null; } public Event get(Class<?> classObj){ for(int i=0; i<events.length; i++){ if(events[i].getClass().equals(classObj)) return events[i]; } return null; } @Override public boolean add(Event managee){ if(get(managee.getClass().getName())==null){ events[events.length]=managee; return true; } return false; } @Override public boolean remove(Event managee){ throw new UnsupportedOperationException(); } public EventManager(SpiderServer server){ this.server=server; init(); } private void init(){ // add a list of events here... } }