⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recstore.java

📁 java程序源代码很好的东西啊,好的不的了啊,大家要下啊
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 


import java.io.PrintStream;

import javax.microedition.rms.InvalidRecordIDException;
import javax.microedition.rms.RecordStore;
import javax.microedition.rms.RecordStoreException;
import javax.microedition.rms.RecordStoreNotOpenException;

public class RecStore
{

    private boolean _$328[];
    public int iHiscore[];
    private int _$327[];
    public static final int iNofHiscores = 0;
    public static final int iNofInts = 35;
    private static final int _$323 = 58;
    public static final int iNofStrings = 23;
    public String sHiscore[];
    private static final String _$322 = "QFA";
    private String _$326[];
    private RecordStore _$330;

    public RecStore()
    {
        sHiscore = new String[0];
        iHiscore = new int[0];
        _$326 = new String[23];
        _$327 = new int[35];
        _$330 = null;
        _$328 = new boolean[58];
        for(int i = 0; i < 58; i++)
            _$328[i] = false;

        try
        {
            _$330 = RecordStore.openRecordStore("QFA", true);
            if(_$330.getNumRecords() < 58)
            {
                boolean flag = false;
                byte abyte0[] = {
                    48
                };
                for(int j = 0; j <= 58; j++)
                    _$330.addRecord(abyte0, 0, 1);

                for(int k = 0; k < 0; k++)
                    _$334(1 + k, "AAA");

                for(int l = 0; l < 35; l++)
                    saveInt(l, 0);

                save();
            }
        }
        catch(Exception exception)
        {
            System.out.println("RecStore Exception (cnstrctr):" + exception);
        }
        int i2 = 1;
        for(int i1 = 0; i1 < 0; i1++)
            sHiscore[i1] = _$336(i2++);

        for(int j1 = 0; j1 < 0; j1++)
            iHiscore[j1] = _$337(i2++);

        for(int k1 = 0; k1 < 23; k1++)
            _$326[k1] = _$336(i2++);

        for(int l1 = 0; l1 < 35; l1++)
            _$327[l1] = _$337(i2++);

        save();
    }

    public void addHiscore(String s, int i)
    {
        if(entersHiscore(i))
        {
            int k;
            for(k = 0; iHiscore[k] >= i; k++);
            for(int j = -2; j >= k; j--)
            {
                sHiscore[j + 1] = sHiscore[j];
                _$328[j + 1] = true;
                iHiscore[j + 1] = iHiscore[j];
                _$328[0 + j + 1] = true;
            }

            sHiscore[k] = s;
            _$328[k] = true;
            iHiscore[k] = i;
            _$328[0 + k] = true;
        }
    }

    public void closeRecStore()
    {
        save();
        if(_$330 == null)
            return;
        try
        {
            _$330.closeRecordStore();
            _$330 = null;
            System.gc();
        }
        catch(Exception exception) { }
    }

    public boolean entersHiscore(int i)
    {
        return i > iHiscore[-1];
    }

    private int _$337(int i)
    {
        return _$352(_$336(i));
    }

    public static void kill()
    {
        try
        {
            RecordStore.deleteRecordStore("QFA");
        }
        catch(Exception exception) { }
    }

    public int loadInt(int i)
    {
        return _$327[i];
    }

    public String loadString(int i)
    {
        return _$326[i];
    }

    private String _$336(int i)
    {
        String s;
        byte abyte0[] = null;
        s = "";
        try {
			abyte0 = _$330.getRecord(i);
		} catch (RecordStoreNotOpenException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InvalidRecordIDException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (RecordStoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        if(abyte0 != null)
        {
        	System.out.println("Record ID=" + i + " doesn't exist");
        	return "0";
        }
        for(int j = 0; j < abyte0.length; j++)
            s = s + (char)abyte0[j];

        return s;
    }

    public void save()
    {
        int j1 = 0;
        for(int i = 0; i < 0; i++)
            if(_$328[j1++])
                _$334(j1, sHiscore[i]);

        for(int j = 0; j < 0; j++)
            if(_$328[j1++])
                _$334(j1, "" + iHiscore[j]);

        for(int k = 0; k < 23; k++)
            if(_$328[j1++])
                _$334(j1, _$326[k]);

        for(int l = 0; l < 35; l++)
            if(_$328[j1++])
                _$334(j1, "" + _$327[l]);

        for(int i1 = 0; i1 < 58; i1++)
            _$328[i1] = false;

    }

    private void _$334(int i, String s)
    {
        byte abyte0[] = s.getBytes();
        try
        {
            _$330.setRecord(i, abyte0, 0, abyte0.length);
        }
        catch(RecordStoreException recordstoreexception)
        {
            System.out.println("Exception (save): " + recordstoreexception + " ID=" + i);
        }
    }

    public void saveInt(int i, int j)
    {
        _$327[i] = j;
        _$328[23 + i] = true;
    }

    public void saveString(int i, String s)
    {
        _$326[i] = s;
        _$328[0 + i] = true;
    }

    private int _$352(String s)
    {
        int i = 0;
        for(int j = 0; j < s.length(); j++)
            i = i * 10 + (s.charAt(j) - 48);

        return i;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -