Subversion Repositories Projects

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/************************************
 *                                  
 * class representing the MK-Version
 * Author:        Marcus -LiGi- Bueschleb
 * Project-Start: 9/2007                                                                                                          *
 *
 * see README for further Infos
 *
 ****************************************/

package org.ligi.ufo;

public class MKVersion

{
    public int major=-1;
    public int minor=-1;
    public int compatible=-1;
    public String str="--";
   

    // version known?
    public boolean known=false;

    public final byte VERSION_AFTER=0;
    public final byte VERSION_EQUAL=1;
    public final byte VERSION_PREVIOUS=2;


    public void set_by_mk_data(int[] data)
    {
        major=data[0];
        minor=data[1];
        compatible=data[2];
        str="v"+major+"."+minor+"/"+compatible;
        known=true;
    }
   
    public byte compare(int major_c,int minor_c)
    {
        if ((major_c==major)&&(minor_c==minor))
            return VERSION_EQUAL;
        // TODO - compare major - PC-COMPATIBLE
        else if (minor_c>minor) return VERSION_AFTER;
        return VERSION_PREVIOUS;
       
    }

}