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; /*w w w .ja va 2 s . com*/ import pemapmodder.spidermine.*; import pemapmodder.spidermine.objects.*; public class CommandHandler implements Manager<Command, String>{ public final SpiderServer server; private Command[] commands; public CommandHandler(SpiderServer server){ this.server=server; } public String invokeCmd(Command cmd, String[] params, CommandIssuer issuer){ return null; } @Override public Command get(String name) { for(int i=0; i<commands.length; i++){ if(commands[i].getName().equalsIgnoreCase(name)) return commands[i]; } return null; } @Override public boolean add(Command command) { if(get(command.getName())==null){ commands[commands.length]=command; return true; } return false; } @Override public boolean remove(Command command) { if(get(command.getName())!=null){ Command[] newCmds={}; for(int i=0; i<commands.length; i++){ if(!commands[i].equals(command)) newCmds[newCmds.length]=commands[i]; } commands=newCmds; return true; } return false; } }