allnotes.java

来自「在java环境下开发的一个笔记记录及管理工具」· Java 代码 · 共 46 行

JAVA
46
字号
package stageexperiment;import java.io.*;public class AllNotes{ File f1;  static int length=0;  Notes all[]=new Notes[100];  public AllNotes() throws IOException  {  for(int i=0;i<100;i++)         all[i]=new Notes();      f1=new File("catalogue.txt");      if(!f1.exists()) f1.createNewFile();     BufferedReader output=new BufferedReader(new FileReader(f1));     String str;     while((str=output.readLine())!=null)       {          int h=0,t=1;         while(str.charAt(t)!='\t')              {t++;}         all[length].writer=str.substring(h,t);h=t+1;t=t+2;         while(str.charAt(t)!='\t')              {t++;}         all[length].filename=str.substring(h,t);h=t+1;t=t+2;         while(str.charAt(t)!='\t')              {t++;}         all[length].ftime=str.substring(h,t);h=t+1;t=t+2;         while(str.charAt(t)!='\t')              {t++;}         all[length].keyword=str.substring(h,t);h=t+1;t=t+2;           while(str.charAt(t)!='\t')              {t++;}         all[length].path=str.substring(h,t);h=t+1;t=t+2;         while(str.charAt(t)!='\t')              {t++;}         all[length].remark=str.substring(h,t);h=t+1;t=t+2;           while(str.charAt(t)!='\t')              {t++;}          all[length].topic=str.substring(h,t);          File f=new File(all[length].path,all[length].filename);          if (f.exists())          length++;     }  }  public int getLength(){return length;}  public void add(Notes n){all[length]=n;length++;}}

⌨️ 快捷键说明

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