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

📄 wordsdb.java

📁 英语背单词联网版本
💻 JAVA
字号:
/* * wordsDb.java * * Created on 2003年11月18日, 下午8:23 */package handenglish;import javax.microedition.lcdui.*;import javax.microedition.midlet.*;import java.util.*;import java.io.*;/** * * @author  com * @version */public class WordsDb {    public Vector m_unitContent;    public int m_wordId,nowUnitType;    Midlet midlet;    public WordsDb(Midlet midlet){        this.midlet=midlet;        m_wordId=0;        nowUnitType=0;        m_unitContent=new Vector();        GetUnit(nowUnitType,m_unitContent);    }    public int getSize(){        return m_unitContent.size()/3;    }    public void GetUnit(int nowUnitId ,Vector nowVector) {        midlet.getUnit(1,nowUnitId,nowVector);        /*try {            InputStream tempDb = this.getClass().getResourceAsStream("words.dat");            InputStream tempIndex = this.getClass().getResourceAsStream("index.dat");            DataInputStream tempWordsDb=new DataInputStream(tempDb);            DataInputStream tempWordsIndex=new DataInputStream(tempIndex);            if ((tempWordsDb!=null)&&(tempWordsIndex!=null)) {                int tempNum=0;                tempWordsIndex.skip(nowUnitId*4*nowNup);                int tempLong=tempWordsIndex.readInt();                tempWordsDb.skip(tempLong);                for(int i=0;i<nowNup;i++) {                    String tempS;                    tempS=tempWordsDb.readUTF();                    nowVector.addElement(tempS);                    tempS=tempWordsDb.readUTF();                    nowVector.addElement(tempS);                    tempS=tempWordsDb.readUTF();                    nowVector.addElement(tempS);                }                tempDb.close();                tempIndex.close();            }        }        catch(Exception e) {        }*/    }    public String getWord() {        return (String)m_unitContent.elementAt(m_wordId*3);    }    public String getChinese(){        return (String)m_unitContent.elementAt(m_wordId*3+2);    }    public int getUnitSize(){        return m_unitContent.size()/3;     }}

⌨️ 快捷键说明

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