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

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

?? database.java

?? 這是手機下載網絡圖像源碼 共初學者參考
?? JAVA
字號:
/* * @(#)Database.java	1.2 03/01/22 * * Copyright (c) 1999-2003 Sun Microsystems, Inc. All rights reserved.  * PROPRIETARY/CONFIDENTIAL * Use is subject to license terms */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| 欧美一区二区精品在线| 久久尤物电影视频在线观看| 亚洲乱码国产乱码精品精98午夜| 国产成人av福利| 久久久www免费人成精品| 国产一区二区三区免费播放| 日韩午夜在线观看| 六月丁香婷婷色狠狠久久| 在线不卡免费欧美| 蜜桃视频在线观看一区二区| 69av一区二区三区| 久久国内精品视频| 久久久久久久久久久99999| 久久精品99国产精品| 久久综合九色综合97婷婷| 国产裸体歌舞团一区二区| 国产精品视频线看| 欧美性生交片4| 狠狠色狠狠色综合系列| 日本一区二区久久| 欧美视频一区二区| 国产精品小仙女| 亚洲天堂网中文字| 精品日韩在线一区| 91啪亚洲精品| 国产做a爰片久久毛片| 一区在线播放视频| 欧美一区二区三区在线观看视频| 国产在线精品免费av| 亚洲综合色婷婷| 久久久不卡网国产精品二区| 色综合一个色综合亚洲| 精品一区二区三区免费播放| 日韩一区中文字幕| 精品三级在线看| 色欧美乱欧美15图片| 亚洲高清视频在线| 精品国产91洋老外米糕| 不卡一区在线观看| 久久国产精品72免费观看| 亚洲欧美中日韩| 中文字幕精品一区二区精品绿巨人| 欧洲一区在线观看| 91麻豆成人久久精品二区三区| 久久99精品一区二区三区| 性久久久久久久久久久久| 成人欧美一区二区三区白人| 久久伊人中文字幕| 日韩精品中文字幕一区二区三区 | 日韩国产一区二| 亚洲激情图片qvod| 中文字幕日韩欧美一区二区三区| 久久久99久久| 国产日韩欧美高清| 国产欧美一区二区精品婷婷 | 日韩一区二区三区视频| 日本高清成人免费播放| 欧美日韩mp4| 欧美一级生活片| 日韩免费高清视频| 久久人人爽人人爽| 国产亚洲成av人在线观看导航| 国产视频在线观看一区二区三区 | 久久99久国产精品黄毛片色诱| 欧美成人一区二区三区| 色偷偷久久一区二区三区| 91猫先生在线| 欧美日韩视频在线第一区| 欧美日韩国产在线播放网站| 欧美酷刑日本凌虐凌虐| 日韩欧美美女一区二区三区| 精品国产免费人成电影在线观看四季 | 日韩欧美亚洲国产另类| 国产精品久久久久一区二区三区共| 国产精品不卡一区二区三区| 亚洲国产视频a| 美女视频第一区二区三区免费观看网站| 精品在线亚洲视频| 91视视频在线直接观看在线看网页在线看| 91黄视频在线| 亚洲国产精品传媒在线观看| 天天爽夜夜爽夜夜爽精品视频| 国产精品一区二区91| 欧美日韩在线三区| 国产精品私房写真福利视频| 日本女人一区二区三区| 一本一本久久a久久精品综合麻豆| 91精品国产乱码久久蜜臀| 亚洲色图欧美激情| 美女一区二区久久| 欧美日韩在线综合| 国产欧美一区视频| 免费在线观看成人| 欧美日韩国产123区| 亚洲黄色免费网站| 欧洲色大大久久| 亚洲人成精品久久久久久| 不卡欧美aaaaa| 久久久久99精品国产片| 午夜精品久久久久久| 国内外成人在线| 91精品久久久久久久91蜜桃 | 一区二区三区四区五区视频在线观看 | 久久先锋影音av鲁色资源网| 日本成人在线视频网站| 欧美一区二区三区免费观看视频| 亚洲成人av中文| 日韩美女天天操| 国产一区二区三区蝌蚪| 国产精品国产三级国产有无不卡| 国产精品伊人色| ●精品国产综合乱码久久久久 | 国产在线精品国自产拍免费| 久久众筹精品私拍模特| 不卡的电视剧免费网站有什么| 中文在线免费一区三区高中清不卡 | 日韩欧美成人激情| 国产成人免费在线视频| 亚洲视频在线观看一区| www.日本不卡| 日日夜夜精品视频天天综合网| 欧美一个色资源| 不卡的av电影在线观看| 亚洲18色成人| 国产精品久久久久久久浪潮网站| 97精品国产97久久久久久久久久久久| 亚欧色一区w666天堂| 国产日韩欧美精品电影三级在线| 一本色道亚洲精品aⅴ| 精品在线播放午夜| 一区二区三区高清不卡| 久久久99精品免费观看不卡| 欧美日韩一区国产| 成人开心网精品视频| 久久不见久久见免费视频7 | 蜜臀久久99精品久久久久久9| 国产精品伦一区二区三级视频| 91麻豆精品国产91久久久| 成人免费视频一区| 激情久久五月天| 男人的天堂久久精品| 亚洲综合激情网| 亚洲综合色区另类av| 国产精品久久午夜| 国产精品国产三级国产普通话三级| 欧美sm美女调教| 久久综合色播五月| 久久夜色精品一区| 久久女同精品一区二区| 精品91自产拍在线观看一区| 日韩视频一区二区在线观看| 3d成人动漫网站| 91精品蜜臀在线一区尤物| 日韩视频中午一区| 精品播放一区二区| 国产精品短视频| 一区二区三区在线观看欧美| 亚洲一二三四区| 日本不卡视频在线观看| 精品一区二区三区av| 狠狠色狠狠色综合系列| av亚洲精华国产精华精华| 日本韩国欧美一区| 精品免费日韩av| 一区二区中文视频| 日本va欧美va瓶| 国产精品18久久久久久久久久久久| 韩国一区二区视频| 成人视屏免费看| 555夜色666亚洲国产免| 久久亚区不卡日本| 亚洲综合一区二区三区| 韩国精品免费视频| 在线视频你懂得一区| 精品国产制服丝袜高跟| 亚洲欧美中日韩| 国产精品综合久久| 欧美日韩一区二区电影| 中文字幕精品综合| 美女精品一区二区| 欧美性受xxxx黑人xyx| 久久久久久久综合| 日韩毛片高清在线播放| 国产精品一二三区| 欧美丰满嫩嫩电影| 亚洲男人天堂av网| 处破女av一区二区| 欧美精品一区二区三区视频| 一区二区在线观看免费| 国产成人av福利| 久久精品亚洲麻豆av一区二区| 亚洲动漫第一页| 色婷婷综合久久久久中文一区二区 | 7777精品伊人久久久大香线蕉 | 在线看一区二区| 亚洲精品va在线观看| 国产酒店精品激情| 欧美成人video|