Subversion Repositories Projects

Rev

Rev 255 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
206 ligi 1
/************************************
2
 *                                  
3
 * class representing the MK-Version
4
 * Author:        Marcus -LiGi- Bueschleb
5
 * Project-Start: 9/2007                                                                                                          *
6
 *
7
 * see README for further Infos
8
 *
9
 ****************************************/
10
package org.ligi.ufo;
11
 
12
public class MKVersion
13
 
14
{
15
    public int major=-1;
16
    public int minor=-1;
17
    public int compatible=-1;
18
    public String str="--";
19
 
20
 
21
    // version known?
22
    public boolean known=false;
23
 
24
    public final byte VERSION_AFTER=0;
25
    public final byte VERSION_EQUAL=1;
26
    public final byte VERSION_PREVIOUS=2;
27
 
28
 
29
    public void set_by_mk_data(int[] data)
30
    {
31
        major=data[0];
32
        minor=data[1];
33
        compatible=data[2];
34
        str="v"+major+"."+minor+"/"+compatible;
35
        known=true;
36
    }
37
 
38
    public byte compare(int major_c,int minor_c)
39
    {
40
        if ((major_c==major)&&(minor_c==minor))
41
            return VERSION_EQUAL;
42
        // TODO - compare major - PC-COMPATIBLE
43
        else if (minor_c>minor) return VERSION_AFTER;
44
        return VERSION_PREVIOUS;
45
 
46
    }
47
 
48
}