Code example for Collection

Methods: clear

0
  public static synchronized boolean add(Warning w) {
    return warnings.add(w);
  } 
 
  public static synchronized void clear() { 
    warnings.clear();
  } 
 
  public static String asString() {
    TreeSet<Warning> T = new TreeSet<Warning>();
    T.addAll(warnings);
    Iterator<Warning> it = T.iterator();
    StringBuffer result = new StringBuffer();
    for (int i = 1; i <= T.size(); i++) {
      result.append(i).append(". ");
      result.append(it.next());
      result.append("\n");
    } 
    return result.toString();
  } 
Experience pair programming with AI  Get Codota for Java