Example #1
0
 /** Get a string representation of this sequential pattern. */
 public String itemsetsToString() {
   StringBuffer r = new StringBuffer("");
   for (Itemset itemset : itemsets) {
     r.append('{');
     for (Integer item : itemset.getItems()) {
       String string = item.toString();
       r.append(string);
       r.append(' ');
     }
     r.append('}');
   }
   return r.append("    ").toString();
 }
Example #2
0
  /**
   * Get a string representation of this sequential pattern, containing the sequence IDs of sequence
   * containing this pattern.
   */
  public String toString() {
    StringBuffer r = new StringBuffer("");
    // For each itemset in this sequential pattern
    for (Itemset itemset : itemsets) {
      r.append('('); // begining of an itemset
      // For each item in the current itemset
      for (Integer item : itemset.getItems()) {
        String string = item.toString();
        r.append(string); // append the item
        r.append(' ');
      }
      r.append(')'); // end of an itemset
    }

    //  add the list of sequence IDs that contains this pattern.
    if (getSequencesID() != null) {
      r.append("  Sequence ID: ");
      for (Integer id : getSequencesID()) {
        r.append(id);
        r.append(' ');
      }
    }
    return r.append("    ").toString();
  }