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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/song/models/TGTimeSignature.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
/*
 
2
 * Created on 29-nov-2005
 
3
 *
 
4
 * TODO To change the template for this generated file go to
 
5
 * Window - Preferences - Java - Code Style - Code Templates
 
6
 */
 
7
package org.herac.tuxguitar.song.models;
 
8
 
 
9
import org.herac.tuxguitar.song.factory.TGFactory;
 
10
 
 
11
/**
 
12
 * @author julian
 
13
 *
 
14
 * TODO To change the template for this generated type comment go to
 
15
 * Window - Preferences - Java - Code Style - Code Templates
 
16
 */
 
17
public abstract class TGTimeSignature {
 
18
        private TGDuration denominator;
 
19
        private int numerator;
 
20
        
 
21
        public TGTimeSignature(TGFactory factory){
 
22
                this.numerator = 4;
 
23
                this.denominator = factory.newDuration();
 
24
        }
 
25
        
 
26
        public int getNumerator() {
 
27
                return this.numerator;
 
28
        }
 
29
        
 
30
        public void setNumerator(int numerator) {
 
31
                this.numerator = numerator;
 
32
        }
 
33
        
 
34
        public TGDuration getDenominator() {
 
35
                return this.denominator;
 
36
        }
 
37
        
 
38
        public void setDenominator(TGDuration denominator) {
 
39
                this.denominator = denominator;
 
40
        }
 
41
        
 
42
        public TGTimeSignature clone(TGFactory factory){
 
43
                TGTimeSignature timeSignature = factory.newTimeSignature();
 
44
                copy(timeSignature);
 
45
                return timeSignature;
 
46
        }
 
47
        
 
48
        public void copy(TGTimeSignature timeSignature){
 
49
                timeSignature.setNumerator(getNumerator());
 
50
                getDenominator().copy(timeSignature.getDenominator());
 
51
        }
 
52
        
 
53
        public boolean isEqual(TGTimeSignature ts){
 
54
                return (getNumerator() == ts.getNumerator() && getDenominator().isEqual(ts.getDenominator()));
 
55
        }
 
56
}