~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/song/helpers/TGTrackSegment.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.song.helpers;
 
2
 
 
3
import java.util.ArrayList;
 
4
import java.util.List;
 
5
 
 
6
import org.herac.tuxguitar.song.factory.TGFactory;
 
7
import org.herac.tuxguitar.song.models.TGMeasure;
 
8
import org.herac.tuxguitar.song.models.TGMeasureHeader;
 
9
 
 
10
public class TGTrackSegment {
 
11
        private int track;
 
12
        private List measures;
 
13
        
 
14
        public TGTrackSegment(int track,List measures){
 
15
                this.track = track;
 
16
                this.measures = measures;
 
17
        }
 
18
        
 
19
        public List getMeasures() {
 
20
                return this.measures;
 
21
        }
 
22
        
 
23
        public int getTrack() {
 
24
                return this.track;
 
25
        }
 
26
        
 
27
        public Object clone(TGFactory factory,List headers){
 
28
                List measures = new ArrayList();
 
29
                for(int i = 0;i < getMeasures().size();i++){
 
30
                        TGMeasure measure = (TGMeasure)getMeasures().get(i);
 
31
                        measures.add(measure.clone(factory,(TGMeasureHeader)headers.get(i)));
 
32
                }
 
33
                return new TGTrackSegment(getTrack(),measures);
 
34
        }
 
35
}