亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? database.java

?? 一個非常全面的手機性能測試項目
?? JAVA
字號:
/* * @(#)Database.java	1.5 01/08/21 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information").  You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. */package example.stock;import javax.microedition.rms.*;import java.util.*;import java.io.EOFException;/** * <p>This class provides a wrapper class for the  * <code>RecordStore</code> class. * It allows for easier addition and deletion as well as better searching and * updating of records.  The used recordIDs are kept in a <code>Vector</code> * which we use to access the indices of the records.  The last used recordID * is stored at the beginning of the database and when the database is opened, * each recordID up to the last one used is tested to see if a record exists in * that position and a new <code>Vector</code> of used recordIDs * is generated.</p> */public abstract class Database {    /**     * The database storing all the records and the last     * used recordID in position 1     */    protected volatile RecordStore database = null;    /**     * The <code>Vector</code> of used recordIDs that are in the database     */    protected volatile Vector recordIDs = null;    /**     * The last used ID in the database     */    protected int lastID = 1;    /**     * The object used to compare two records and see if they are equal     */    protected RecordComparator rc = null;    /**     * <p>Initializes the database and if it's not a new database, loads the     * recordID of the last record out of the first position in the     * <code>RecordStore</code>.  We have stored it there when we closed the     * database, then checks each ID from 1 to lastID to see if they exist in     * the database and then add the IDs that exist to the recordIDs     * <code>Vector</code></p>     *     * @param fileName The name of the <code>RecordStore</code> to open     * @throws <code>RecordStoreNotFoundException</code> is thrown if the     *         <code>RecordStore</code> indicated with <code>fileName</code>     *         cannot be found     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     * @throws <code>RecordStoreFullException</code> is thrown when the     *         storage system is is full     */    public void open(String fileName) throws RecordStoreNotFoundException,                                             RecordStoreException,                                             RecordStoreFullException {        database = RecordStore.openRecordStore(fileName, true);        recordIDs = new Vector();        try {            if (database.getNumRecords() != 0) {                try {                    lastID = 			Integer.valueOf(			    new String(database.getRecord(1))).intValue();                    for (int i = 1; i <= lastID; i++) {                        try {                            database.getRecord(i);                            recordIDs.addElement(new Integer(i));                        } catch (RecordStoreException rs) {}                    }                } catch (InvalidRecordIDException iri) {                    throw new RecordStoreException(iri.getMessage());                }            }        } catch (RecordStoreNotOpenException rsno) {            throw new RecordStoreException(rsno.getMessage());        }    }    /**     * <p>Close the database and remove it from persistant      * storage if it is empty</p>     *     * @throws <code>RecordStoreNotOpenException</code> is thrown when trying     *         to close a <code>RecordStore</code> that is not open     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     */    public void close() throws RecordStoreNotOpenException,                               RecordStoreException {        if (database.getNumRecords() == 0) {            String fileName = database.getName();            database.closeRecordStore();            database.deleteRecordStore(fileName);        } else {            database.closeRecordStore();        }    }    /**     * <p>Remove the database from persistant storage</p>     *     * @param fileName the name of the <code>RecordStore</code> to remove     */    public void cleanUp(String fileName) throws RecordStoreNotFoundException,                                                RecordStoreException {        RecordStore.deleteRecordStore(fileName);        open(fileName);    }    /**     * <p>Add the record to the database<BR>     * Add the recordID to our vector<BR>     * Update the database's last ID counter</p>     *     * @param record The record data to be added to the database     * @throws <code>RecordStoreNotOpenException</code> is thrown when     *         trying to close a <code>RecordStore</code> that is not open     * @throws <code>RecordStoreFullException</code> is thrown when the storage     *         system is is full     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     */    public synchronized void add(String record)	throws RecordStoreNotOpenException,	RecordStoreFullException,	RecordStoreException {        if (database.getNumRecords() != 0) {            database.addRecord(record.getBytes(), 0, record.getBytes().length);            recordIDs.addElement(new Integer(++lastID));            database.setRecord(1, (String.valueOf(lastID)).getBytes(),                               0, (String.valueOf(lastID)).length());        } else {            recordIDs.addElement(new Integer(++lastID));            database.addRecord((String.valueOf(lastID)).getBytes(),                               0, (String.valueOf(lastID)).length());            try {                database.addRecord(record.getBytes(), 0,				   record.getBytes().length);            } catch (RecordStoreException rs) {                recordIDs.removeElement(new Integer(lastID--));                database.setRecord(1, (String.valueOf(lastID)).getBytes(),                                   0, (String.valueOf(lastID)).length());                throw rs;            }        }    }    /**     * <p>Delete the record from the database and remove that recordID from the     * vector of used recordIDs</p>     *     * @param s The name of the record to delete from the database     * @throws <code>RecordStoreNotOpenException</code> is thrown when trying     *         to close a <code>RecordStore</code> that is not open     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     */    public synchronized void delete(String s)	throws RecordStoreNotOpenException,	RecordStoreException {        action(s, null, 0);    }    /**     * <p>Find and return a record</p>     *     * @return The record that we're looking for or      * <code>null</code> if not found     * @param s The name of the record to search for     * @throws <code>RecordStoreNotOpenException</code> is thrown when trying     *         to close a <code>RecordStore</code> that is not open     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     */    public synchronized String search(String s)            throws RecordStoreNotOpenException, RecordStoreException {        return (String) action(s, null, 1);    }    /**     * <p>Update the record with the name <code>s</code> with the data     * in the byte[] array</p>     *     * @param s The name of the record to update     * @param data the new data to update the record with     * @throws <code>RecordStoreNotOpenException</code> is thrown when trying     *         to close a <code>RecordStore</code> that is not open     * @throws <code>RecordStoreFullException</code> is thrown when the storage     *         system is is full     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     */    public synchronized void update(String s, byte[] data)            throws RecordStoreNotOpenException, RecordStoreFullException,	RecordStoreException {        action(s, data, 2);    }    /**     * <p>Go to the index of the record specified by <code>s</code> and perform     * an action.  Either an update, search or deletion.  This method is for     * code compaction as the process for updating, searching and     * deleting varies only slightly.</p>     *     * @param s The name of the record to perform the action on     * @param data Data to use in the action     * @param action What to do. 0 = delete, 1 = search, 2 = update     * @throws <code>RecordStoreNotOpenException</code> is thrown when trying     *         to close a <code>RecordStore</code> that is not open     * @throws <code>RecordStoreFullException</code> is thrown when the storage     *         system is is full     * @throws <code>RecordStoreException</code> is thrown when a general     *         exception occurs in a <code>RecordStore</code> operation     */    private synchronized Object action(String s, byte[] data, int action)        throws RecordStoreNotOpenException, RecordStoreFullException,	RecordStoreException {        if ((action != 1) && (recordIDs.size() == 0)) {            throw new RecordStoreException();        }        Enumeration IDs = recordIDs.elements();        while (IDs.hasMoreElements()) {            int index = ((Integer) IDs.nextElement()).intValue();            try {                if (rc.compare(database.getRecord(index), s.getBytes())                        == RecordComparator.EQUIVALENT) {                    switch (action) {                    case 0:                        database.deleteRecord(index);                        recordIDs.removeElement(new Integer(index));                        return null;                    case 1:                        return new String(database.getRecord(index));                    case 2:                        database.setRecord(index, data, 0, data.length);                        return null;                    default:                        break;                    }                }            } catch (InvalidRecordIDException iri) {                throw new RecordStoreException(iri.getMessage());            }        }        return null;    }    /**     * <p>Return the number of records in the database</p>     *     * @return the number of records in the database     * @throws <code>RecordStoreNotOpenException</code> is thrown when trying     *         to close a <code>RecordStore</code> that is not open     */    public int getNumRecords() throws RecordStoreNotOpenException {        return database.getNumRecords();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费人成网站在线观看欧美高清| 日本午夜一本久久久综合| 国产精品色在线观看| 亚洲免费av高清| 日欧美一区二区| 国产成人免费xxxxxxxx| 91色|porny| 欧美一级黄色大片| 亚洲人成在线播放网站岛国| 亚洲福利视频一区| 国产自产高清不卡| 欧美日韩中文字幕一区| 精品99一区二区| 亚洲色图丝袜美腿| 蜜桃久久av一区| 91首页免费视频| 国产日韩欧美麻豆| 久热成人在线视频| 91精品国产手机| 亚洲成av人片www| 在线视频欧美区| 亚洲天堂中文字幕| 成人av集中营| 中文字幕欧美日韩一区| 大白屁股一区二区视频| 精品日韩在线一区| 蜜桃视频一区二区三区在线观看 | 国产精品一级片| 日韩西西人体444www| 青草av.久久免费一区| 欧美色爱综合网| 亚洲电影一区二区| 欧美高清激情brazzers| 亚洲成人免费观看| 8x8x8国产精品| 麻豆视频观看网址久久| 精品欧美一区二区三区精品久久| 精品在线播放免费| 久久久三级国产网站| 国产激情一区二区三区桃花岛亚洲| 日韩你懂的电影在线观看| 国内外成人在线| 国产片一区二区| av午夜一区麻豆| 亚洲综合一区二区三区| 欧美精品一级二级三级| 狠狠色丁香婷婷综合| 国产精品视频你懂的| 日本精品裸体写真集在线观看| 亚洲一区电影777| 4hu四虎永久在线影院成人| 另类小说一区二区三区| 国产丝袜欧美中文另类| 91麻豆高清视频| 石原莉奈在线亚洲二区| 国产亚洲午夜高清国产拍精品| 成人永久aaa| 亚洲国产日韩综合久久精品| 日韩精品在线一区二区| 成人免费视频播放| 亚洲国产美女搞黄色| 日韩欧美国产综合| 99精品视频在线观看免费| 亚洲五码中文字幕| 精品国产91洋老外米糕| 不卡欧美aaaaa| 奇米影视一区二区三区小说| 国产视频一区在线播放| 欧美日韩国产首页在线观看| 精品一区二区三区欧美| 亚洲男同1069视频| 精品久久久三级丝袜| 色综合久久88色综合天天6| 久久国产精品99精品国产| 亚洲乱码中文字幕| 久久久久国产一区二区三区四区| 欧美怡红院视频| 国产精品一区二区91| 日韩精品乱码av一区二区| 国产精品久久久久一区二区三区 | 欧洲国产伦久久久久久久| 狠狠狠色丁香婷婷综合激情| 一区二区理论电影在线观看| 久久综合狠狠综合久久综合88| 色综合久久久网| 国产精品99久久久| 免费观看一级欧美片| 亚洲女同一区二区| 国产日韩欧美一区二区三区综合 | 国产精品免费人成网站| 欧美精品三级在线观看| 99re6这里只有精品视频在线观看| 秋霞电影网一区二区| 亚洲一区二区在线播放相泽| 国产日韩欧美麻豆| 久久久久久免费毛片精品| 日韩一级黄色大片| 欧美久久久久中文字幕| 一本一道久久a久久精品| 国产91丝袜在线播放0| 久久99国产精品成人| 人人爽香蕉精品| 蜜桃视频在线观看一区二区| 午夜欧美一区二区三区在线播放 | 亚洲欧美日韩国产另类专区| 国产欧美一区在线| 久久久另类综合| 久久久久亚洲综合| 久久久久免费观看| 国产欧美综合在线| 国产清纯美女被跳蛋高潮一区二区久久w | 国产精品一二三区在线| 狠狠色丁香久久婷婷综合_中| 久久电影网站中文字幕| 开心九九激情九九欧美日韩精美视频电影| 亚洲成人tv网| 日韩电影在线观看网站| 日本不卡1234视频| 老司机精品视频一区二区三区| 日韩电影免费在线观看网站| 日本亚洲欧美天堂免费| 麻豆专区一区二区三区四区五区| 日本不卡高清视频| 国产综合久久久久久鬼色| 国产麻豆精品视频| 风间由美一区二区av101| voyeur盗摄精品| 99精品偷自拍| 这里只有精品免费| 欧美精品一区二区三区一线天视频| 久久久精品免费观看| 中文字幕一区二区在线观看| 一区二区三区成人| 日韩av一区二区三区四区| 老司机精品视频导航| 国产v综合v亚洲欧| 欧美在线|欧美| 精品国产一区二区三区久久久蜜月| 国产欧美一区二区三区沐欲 | 99精品欧美一区二区三区综合在线| 91丝袜美女网| 91精品国产综合久久福利软件| 久久综合色婷婷| 中文字幕一区免费在线观看| 五月综合激情网| 国产 日韩 欧美大片| 欧美午夜寂寞影院| 精品粉嫩超白一线天av| 亚洲三级免费观看| 免费在线观看视频一区| 高清shemale亚洲人妖| 欧美另类高清zo欧美| 久久久不卡网国产精品二区| 亚洲影院免费观看| 国产老肥熟一区二区三区| 91视频在线观看免费| 欧美大片在线观看一区| 一区二区三区在线不卡| 久久av老司机精品网站导航| 色婷婷国产精品久久包臀| 久久亚洲综合色一区二区三区| 一区二区三区四区不卡在线| 经典三级一区二区| 欧美日本一区二区三区四区| 欧美经典一区二区| 日本强好片久久久久久aaa| 白白色 亚洲乱淫| 久久欧美一区二区| 奇米一区二区三区| 欧美亚洲愉拍一区二区| 国产精品久久久久影院亚瑟| 精品一二三四在线| 欧美日韩精品免费观看视频 | 日韩和欧美的一区| 色噜噜夜夜夜综合网| 欧美国产精品劲爆| 精品一区二区三区香蕉蜜桃| 777奇米成人网| 天天影视涩香欲综合网| 色婷婷av一区| 亚洲人成网站精品片在线观看| 国产精品69毛片高清亚洲| 6080日韩午夜伦伦午夜伦| 亚洲成人一区在线| 欧美亚洲免费在线一区| 亚洲激情在线播放| 99热精品一区二区| 1000部国产精品成人观看| 成人免费视频视频在线观看免费| 欧美精品一区二区三区四区 | 久久国产麻豆精品| 欧美一区日本一区韩国一区| 亚洲第一狼人社区| 91激情五月电影| 亚洲另类在线视频| 91成人免费在线| 一区二区三区中文字幕电影| 91国偷自产一区二区三区观看| 国产精品传媒视频| 91丝袜美女网|