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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/util/TGVersion.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mfrom: (1.1.1 upstream) (2.1.3 hardy)
  • Revision ID: james.westby@ubuntu.com-20080619003030-agens2gvd5m4dacu
New upstream release (Closes: #481728) also (LP: #176979, #212207)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.util;
 
2
 
 
3
public class TGVersion {
 
4
        
 
5
        public static final TGVersion CURRENT = new TGVersion(1,0,0);
 
6
        
 
7
        private int major;
 
8
        private int minor;
 
9
        private int revision;
 
10
        
 
11
        public TGVersion(int major,int minor, int revision){
 
12
                this.major = major;
 
13
                this.minor = minor;
 
14
                this.revision = revision;
 
15
        }
 
16
        
 
17
        public int getMajor() {
 
18
                return this.major;
 
19
        }
 
20
        
 
21
        public int getMinor() {
 
22
                return this.minor;
 
23
        }
 
24
        
 
25
        public int getRevision() {
 
26
                return this.revision;
 
27
        }
 
28
        
 
29
        public boolean isSameVersion(TGVersion version){
 
30
                if( version == null ){
 
31
                        return false;
 
32
                }
 
33
                return ( version.getMajor() == getMajor() && version.getMinor() == getMinor() && version.getRevision() == getRevision());
 
34
        }
 
35
        
 
36
        public String getVersion(){
 
37
                String version = (getMajor() + "." + getMinor());
 
38
                if( getRevision() > 0 ){
 
39
                        version += ("." + getRevision());
 
40
                }
 
41
                return version;
 
42
        }
 
43
        
 
44
        public String toString(){
 
45
                return getVersion();
 
46
        }
 
47
}