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

📄 fieldstructure.java

📁 j2me下的1套UI框架.包含j2me开发中会应用的各种低级组件
💻 JAVA
字号:
package com.jmobilecore.dstore;

/**
 * A <code>FieldStructure</code> represents a description of a record field
 *
 * @author 	Greg Gridin
 */
public class FieldStructure {

    /**
     * The NULL value.
     */
    public static final int NULL = 0x80000000;

    /**
     * The INTEGER type. Value range is from -(2**32-1) to 2**32-1
     */
    public static final int INTEGER = 1;

    /**
     * The BOOLEAN type. Values are <code>true</code> and <code>false</code>
     */
    public static final int BOOLEAN = 2;

    /**
     * The STRING type.
     * First 2 bytes represents offset from beginning of record.
     * Next 2 bytes represents length of string in bytes. (Note: this value could differ from string length)
     */
    public static final int STRING = 3;

    /**
     * The BINARY type.
     * First 2 bytes represents offset from beginning of record.
     * Next 2 bytes represents length of string in bytes.
     */
    public static final int BINARY = 4;

    /**
     * The field name.
     */
    public String name;

    /**
     * The field type.
     */
    public int type;

    /**
     * Creates a field structure.
     * @param  name the field name.
     * @param  type the field type
     */
    public FieldStructure(String name, int type) {

        this.name = name;
        this.type = type;
    }

    /**
     * Reports whether the type defines data of variable size
     * @param  type the field type
     * @return <code>true</code> if type is defines data of variable length, <code>false</code> otherwise
     */
    static public boolean hasVariableLength(int type) {
        return type==STRING || type==BINARY;
    }
}

⌨️ 快捷键说明

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