?? wordsdb.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 + -