コード例 #1
0
  /**
   * Creates the TGChord ArrayList out of StringValue's ArrayLists
   *
   * @param Highest rated StringValues
   * @return TGChord collection
   */
  private ArrayList createChords(ArrayList top) {
    if (!isValidProcess()) {
      return null;
    }

    ArrayList chords = new ArrayList(top.size());

    Iterator it = top.iterator();

    while (it.hasNext()) {
      TGChord chord =
          TuxGuitar.instance().getSongManager().getFactory().newChord(this.tuning.length);
      Iterator it2 = ((ArrayList) it.next()).iterator();

      while (it2.hasNext()) {
        StringValue stringValue = (StringValue) it2.next();
        int string = ((chord.getStrings().length - 1) - (stringValue.getString()));
        int fret = stringValue.getFret();
        chord.addFretValue(string, fret);
        chord.setName(this.chordName);
      }

      chords.add(chord);
    }
    return chords;
  }