/** * default constructor. */ public CommandlineCompletion() { super(); // build incremental list of packages if (m_Packages == null) { // get all packages Vector<String> list = ClassDiscovery.findPackages(); // create incremental list HashSet<String> set = new HashSet<String>(); for (int i = 0; i < list.size(); i++) { String[] parts = list.get(i).split("\\."); for (int n = 1; n < parts.length; n++) { String pkg = ""; for (int m = 0; m <= n; m++) { if (m > 0) { pkg += "."; } pkg += parts[m]; } set.add(pkg); } } // init packages m_Packages = new Vector<String>(); m_Packages.addAll(set); Collections.sort(m_Packages); m_Trie = new Trie(); m_Trie.addAll(m_Packages); } }
/** * default constructor. */ public CommandlineCompletion() { super(); // build incremental list of packages if (m_Packages == null) { // get all packages Vector list = ClassDiscovery.findPackages(); // create incremental list HashSet<String> set = new HashSet<String>(); for (int i = 0; i < list.size(); i++) { String[] parts = ((String) list.get(i)).split("\\."); for (int n = 1; n < parts.length; n++) { String pkg = ""; for (int m = 0; m <= n; m++) { if (m > 0) pkg += "."; pkg += parts[m]; } set.add(pkg); } } // init packages m_Packages = new Vector<String>(); m_Packages.addAll(set); Collections.sort(m_Packages); m_Trie = new Trie(); m_Trie.addAll(m_Packages); } }