/** * This snoops through the CCI and gets those methods that are not * in Java.lang.Object, are public and are not static. Note that this will * return all the unique names in the commands array. This method is not tasked * with dis-ambiguating them. * * @return java.lang.String[] */ public static String[] getCommandsNameList(Commands[] commands) { HashMap<String, Integer> names = new HashMap<String, Integer>(); // trick with the hash map to keep a running list of unique names, which are keys there. for(int i=0; i<commands.length ; i++){ Method[] CCIM = commands[i].getClass().getMethods(); for (int i0 = 0; i0 < CCIM.length; i0++) { if (!isJavaObjectMethod(CCIM[i0].getName(), CCIM[i0].getModifiers()) && hasRightSignature(CCIM[i0])) { names.put(CCIM[i0].getName(), 0); } } // end i0-loop } return names.keySet().toArray(new String[0]); }