Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.query;
 
import base.Query;
public class Help extends Query<KeyValue> {
	public List<KeyValueexecute() throws IOException {
		List<KeyValueresults = new LinkedList<>();
		ServiceLoader<Commandcommands = ServiceLoader.load(Command.class);
		ServiceLoader<Queryqueries = ServiceLoader.load(Query.class);
		for(Command c : commands) {
			results.add(new KeyValue(c.getClass().getSimpleName(), "Command"));
		}
		for(Query q : queries) {
			results.add(new KeyValue(q.getClass().getSimpleName(), "Query"));
		}
		return results;
	}
		return "{}";
	}
		return new Help();
	}
New to GrepCode? Check out our FAQ X