import java.io.*; ///* /// ///辞書の元となるものです。 ///データーはデーター群をほじすることがてきます。 ///そして、アドレスを保持できます。 /// ///*/ class Index { IndexData head; public Index() { head = new IndexData('h'); } public IndexData IndexData() { return head; } public IndexData getChild() { return head.getChild(); } public IndexData getChild(int i) { return head.getChild(i); } public void add(String st,String adress,int index) { add(st, adress, index,head); } public void add(String st,String adress,int index,IndexData state) { IndexData temp = null; if(index < (st.length())) { temp = state.search(st.charAt(index)); if(temp == null) { temp = new IndexData(st.charAt(index)); state.addChild(temp); temp.VolumePlus(1); } else { temp.VolumePlus(1); } } if(index < (st.length()-2)) { add(st,adress,++index,temp); } if(index == (st.length()-1)) { IndexData d; if( null != ( d = this.head.getChild()) ) { } } } public IndexData searchIndexData(String str) { IndexData temp = head; for(int i= 0; i < str.length();i++) { temp = temp.search(str.charAt(i)); if(temp == null){return null;} } return temp; } public boolean includeKeyword(String name,String keyword) { File dir = new File(name); File temp; for(int i= 0; i < keyword.length();i++) { if(false ==dir.exists()){return false;} dir = new File(dir,new String().valueOf(new Character(keyword.charAt(i)))); if(dir.exists()==false){return false;} } return true; } public IndexData searchFile(String name ,String key) { RandomAccessFile fr = null; IndexData temp = new IndexData('h'); try { File fir = new File(name); fr = new RandomAccessFile(fir,"r"); temp.readFileHeader(fr); }catch(Exception e) { } long sum = 0; int num = 0; for(int i = 0;i