public String toString(int maxNumber) { Collections.sort(associationRules); StringBuffer buffer = new StringBuffer("Association Rules" + Tools.getLineSeparator()); int counter = 0; for (AssociationRule rule : associationRules) { if ((maxNumber >= 0) && (counter > maxNumber)) { buffer.append("... " + (associationRules.size() - maxNumber) + " other rules ..."); break; } buffer.append(rule.toString()); buffer.append(Tools.getLineSeparator()); counter++; } return buffer.toString(); }