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