settings.java

来自「Online Map for Mobile」· Java 代码 · 共 32 行

JAVA
32 行
字号
public class Settings { 
    int    flags;
    int    cacheSize;
    String locale;

    static final int FAST_SCROLL = 1;
    static final int AUTO_ZOOM   = 2;
    static final int BLINKING    = 4;

    static final int MAX_CACHE_SIZE = 10;

    byte[] pack() { 
        byte[] record = new byte[4];
        record[0] = (byte)flags;
        record[1] = (byte)locale.charAt(0);
        record[2] = (byte)locale.charAt(1);
        record[3] = (byte)cacheSize;
        return record;
    }

    Settings(byte[] record) { 
        flags = (byte)record[0];
        locale = new String(record, 1, 2);
        cacheSize = (byte)record[3];
    }

    Settings() {
        flags = FAST_SCROLL|AUTO_ZOOM|BLINKING;
        cacheSize = 4;
        locale = System.getProperty("microedition.locale").substring(0, 2);
    }
}

⌨️ 快捷键说明

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