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

« back to all changes in this revision

Viewing changes to src/org/herac/tuxguitar/song/models/Tupleto.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 05-dic-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 java.io.Serializable;
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 class Tupleto implements Serializable{
18
 
    /**
19
 
     * Cantidad de Duraciones que entran en los tiempos
20
 
     */
21
 
    private int enters;
22
 
    /**
23
 
     * Tiempos
24
 
     */
25
 
    private int times;
26
 
    
27
 
    public Tupleto(int enters,int times){
28
 
        this.enters = enters;
29
 
        this.times = times;
30
 
    }
31
 
    
32
 
    
33
 
    public int getEnters() {
34
 
        return enters;
35
 
    }
36
 
    public void setEnters(int enters) {
37
 
        this.enters = enters;
38
 
    }
39
 
    public int getTimes() {
40
 
        return times;
41
 
    }
42
 
    public void setTimes(int times) {
43
 
        this.times = times;
44
 
    }
45
 
    
46
 
    public long convertTime(long time){
47
 
        return time * times / enters;
48
 
    }
49
 
    
50
 
    public boolean isEqual(Tupleto tupleto){
51
 
        return (tupleto.getEnters() == getEnters() && tupleto.getTimes() == getTimes());
52
 
    }
53
 
    
54
 
    public Object clone(){
55
 
        return new Tupleto(this.enters,this.times);
56
 
    }
57
 
}