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