/** * Find a new name that isn't among the used names. * * @param prefix * @param usedNames * @return */ public static String unusedName(String prefix, Iterator usedNames) { SortedSet u = new TreeSet(); while (usedNames.hasNext()) { String curr = (String) usedNames.next(); if (curr.startsWith(prefix)) { String postfix = curr.substring(prefix.length()); u.add(postfix); } } int count = 0; while (u.contains(String.valueOf(count))) { count++; } return prefix + count; }
public Object next() { return ((AttrConfig) attrs.next()).getAttrName(); }
public Object next() { return ((Config) descs.next()).getDescName(); }
public boolean hasNext() { return attrs.hasNext(); }
public boolean hasNext() { return descs.hasNext(); }