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

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

?? hdocsearcher.java

?? 站內文本搜索Java小程序 SearchToHTML applet小程序可以讓你對指定的若干文件進行文本搜索
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
//SearchToHTML copyright (c) 1999 David Faden.
//The applet class files and source code are distributed as linkware...
//If you use this applet or a variant on its code,
//include a link to The Gilbert Post, 
//http://www.geocities.com/Athens/Parthenon/1911
//The Gilbert Post and David Faden take no responsibility
//for anything bad that happens as a result of using this applet.
//Please send reports of problems to gilbertnews@hotmail.com, anyway, though.
//

// Modification log:
//
// 4/12/2000 fixed a "Y2K bug reported by several alert users...  I am not sure what 
// I was thinking when I wrote the portion of code calling Date.getYear()... Perhaps that it
// returns the decade? Anyway, in reality, getYear() returns the number of years
// since 1900. Files with modification dates beyond 1999 were listed with dates greater than
// 99 (100 for 2000).
// Note: the whole Date class is deprecated in JDK 1.1
// The code actually changed is found in HDocSearcher.java.
// 
// 4/12/2000 added code that causes the HDocSearcher's runner Thread to wait
// when it is not "doing anything." This should be more efficient than in the
// previous incarnation, where runner would sleep, then periodically wake up to 
// see if there was anything to search.
//
// Jul 12 2000 I added a kludgy method to HDocSearcher which will
// finish extracting the title from a document even if a match is
// found within the title. I had been reminded of this behavior several
// times before, but it was Danny Narayan's complaint that spurred me to action.
// See HDocSearcher.finishTitle(StringBuffer).
// Finishing the title exposed another problem: the boolean inTITLE was not
// set to false even on finding the end of a title.
//
// Jul 13 2000 I seem to be writing a lot broken sentences in this bug log.
// But that okay.
// Changed the name of the method "foundNoMatch" to "receiveNoMatch." Again,
// I think that the former name was misleading. Added two new parameters to
// deal with expanded context capabilities: leadingContextLength and
// trailingContextLength - leadingContextLength is very misleadingly named.
// I will probably change it tomorrow. The new parameters I was alluding to
// are "leadingcontextlength" and "trailingcontextlength". Not yet documented! 
// I added a new method to HDocSearcher.java: appendTrailingContext(StringBuffer)
// and changed HDocSearcher's constructor in connection with the new trailing context
// stuff.
//
// Jul 15 2000 Fixed "bugs" in HDocSearcher.java that would cause an 
// ArrayOutOfBoundsException to be thrown if leadingContextLength==0. Previous to a few
// edits ago, I had required that this value be greather than zero so the code's
// assumption had been a safe one.
//
// Jul 25 2000 Fixed a bug in appendTrailingContext(StringBuffer). The fix required that
// the method not append directly from the input stream to the context (this was the source
// of the problem) so I renamed appendTrailingContext(StringBuffer) to getTrailingContext().
//
// Aug 17, 2000 Changed code to look directly for EOF and on EOF, to pass 
// '\0' to the SearchSieves rather than (char)-1. 

import java.io.*;
import java.net.*;
import java.util.*;

class HDocSearcher implements Runnable {
  private static final String[] months ={"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
  private BufferedInputStream bis=null;
  private SearchToHTML parent;
  private volatile boolean searching;
  private volatile boolean running=false;//should the main loop be running?
  private URL url;
  //if there is a horrible error such as a MalformedURLException
  //or a SecurityException refuse to search anymore...
  private volatile boolean noHorribleError;
  private int index;//our index according to parent
  private SearchSieve[] searchers;
  private boolean addedinfo=false;
  private Thread runner;//this DocSearcher's Thread
  private boolean cutHTML=false;
  private boolean bexact=false;
  
  /**
   * Array containing characters preceding and including a match.
   */
  private char[] context;
  
  /**
   * The actual number characters held in context (or one more).
   */ 
  private int contextsize;//allow this to grow past end of context so
  //that we will know if the context is completely filled.
  
  /**
   * Current position in the context array.
   */
  private int contextposition;
  
  private SearchSieve titlefinder=new SearchSieve("<title>".toCharArray(),false);
  private SearchSieve anchorfinder=new SearchSieve("<a name=".toCharArray(),false);
  private boolean gotTitle=false;
  
  //XXX! leadingContextLength _includes_ the match!
  /**
   * How many characters previous to the match should be returned.
   */
  private int leadingContextLength;
  
  /**
   * How many characters following the match should be returned.
   */
  private int trailingContextLength;
  
  /**
   * Used to synchronize search methods.
   */
  private final Object searchLock=new Object();
  
  public HDocSearcher(SearchToHTML parent,URL url,
            int index,int leadingContextLength, int trailingContextLength) {
    searching=false;
    this.parent=parent;
    this.url=url;
    noHorribleError=true;
    this.index=index;
    this.leadingContextLength = leadingContextLength;
    if (leadingContextLength<0)
        leadingContextLength=0;
    this.trailingContextLength = trailingContextLength;
    if (trailingContextLength<0)
        trailingContextLength=0;
    if (leadingContextLength>0)
        context=new char[leadingContextLength];
    else
        context=null;
    contextsize=0;
    contextposition=0;
  }
  
  public final void searchFor(String[] s, boolean bexact, boolean cutHTML) {
    stopSearch();
    synchronized (searchLock) {
        contextsize=0;
        contextposition=0;
        if(!noHorribleError) return;
        this.bexact=bexact;
        this.cutHTML=cutHTML;
        searchers=new SearchSieve[s.length];
        //It's not efficient to create new SearchSieves each time.
        //SearchSieve already provides a method, setKey(char[],boolean),
        //but I'm not sure how I'd like to implement the SearchSieve pool.
        for (int i=0;i<s.length;i++) {
           searchers[i]=new SearchSieve(s[i].toLowerCase().toCharArray(),bexact);
        }
        searching=true;
        //System.out.println("SearchThread:"+index+":"+searchstrings);
        if (!running) {
          running=true;
          runner=new Thread(this,"DocSearcher"+index+" runner");
          runner.start();//start runner
        }
        try {
            searchLock.notify();
        }
        catch (IllegalMonitorStateException imse) {
            imse.printStackTrace(System.err);
        }
    }
  }
  
  //do not use this method
  //it is a crutch to deal with a problem in the Applet's init
  public final void setErrored() {
    noHorribleError=false;
  }
  
  public final boolean isErrored() {
    return !noHorribleError;
  }
  
  //This might not lead to a graceful close of bis.
  //I think I've fixed the above problem, though.
  //This currently doesn't block - 
  //should it?
  public final void stopSearch() {
    searching=false;
  }
  
  public final void stopRunning() {
    stopSearch();
    synchronized (searchLock) {
        running=false;
        try {
            searchLock.notify(); //runner will start running once
            //the current Thread releases searchLock
        }
        catch (IllegalMonitorStateException imse) {
            imse.printStackTrace(System.err);
        }
    }
  }
  
  //where the searching gets done
  //if file exhausted or match found notify the parent
  public final void run() {
    synchronized (searchLock) {
        while (running && noHorribleError) {
           if(searching) {
             dosearch();
             searching=false;
           }
           try {
               searchLock.wait();
           }
           catch (InterruptedException ie) {
               ie.printStackTrace(System.err);
           }
        }
    }
  }
  
  private boolean openConnection() {
      //setup connection
    try{
       URLConnection uc=url.openConnection();
       if(!addedinfo) {
         addedinfo=true;
         Date d=new Date(uc.getLastModified());
         int length=uc.getContentLength()/1024;
         parent.addInfo(index,new String(length+"k,  "+months[d.getMonth()]+" "+
                                                d.getDate()+" "+(d.getYear()+1900)));
       }
       bis=new BufferedInputStream(uc.getInputStream());
    }
    catch(FileNotFoundException fnfe) {
      System.out.println(fnfe);
      closeConnection();
      noHorribleError=false;
      parent.receiveNoMatch(index);
      return false;
    }
    catch(IOException e) {
      System.out.println(e);
      closeConnection();
      parent.receiveNoMatch(index);
      return false;
    }
    catch(SecurityException se) {
      System.out.println(se);
      noHorribleError=false;
      closeConnection();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费高清视频在线| 成人激情免费网站| 国产精品一区二区在线观看网站| 国产99久久精品| 欧美日本国产一区| 国产精品毛片a∨一区二区三区| 亚洲国产另类av| 99久久精品国产网站| 制服丝袜在线91| 亚洲狼人国产精品| 成人午夜碰碰视频| 欧美第一区第二区| 日韩精品欧美精品| 精品视频一区二区不卡| 亚洲欧洲在线观看av| 黄网站免费久久| 日韩欧美视频在线| 国产精品一区二区你懂的| 欧美精品vⅰdeose4hd| 亚洲免费毛片网站| 成人h动漫精品一区二区| 久久久久综合网| 国产一区二区导航在线播放| 日韩三级视频在线看| 日韩高清不卡一区二区| 欧美精品少妇一区二区三区| 一区二区三区成人在线视频| 波多野结衣欧美| 欧美国产日本视频| 久久99精品国产麻豆不卡| 日韩亚洲电影在线| 五月婷婷综合在线| 91精品在线免费| 午夜精品免费在线观看| 欧美精品丝袜中出| 日本vs亚洲vs韩国一区三区二区 | 天天色综合天天| 欧美日韩在线不卡| 日韩中文字幕亚洲一区二区va在线| 欧洲av在线精品| 丝袜亚洲另类欧美| 日韩免费性生活视频播放| 九色porny丨国产精品| 精品av久久707| 国产91精品入口| 亚洲卡通欧美制服中文| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | av在线一区二区| 亚洲私人黄色宅男| 欧美日韩午夜精品| 久久超碰97人人做人人爱| 国产无人区一区二区三区| 99久久伊人久久99| 一区二区三区av电影| 69堂亚洲精品首页| 国产高清视频一区| 一区二区三区不卡视频| 日韩欧美一级在线播放| 成人一区二区三区视频在线观看 | 久久久久9999亚洲精品| 波多野结衣一区二区三区| 亚洲综合激情网| 精品成a人在线观看| www.av亚洲| 免费看日韩精品| 国产精品美女久久福利网站| 欧美久久一二区| 国产成人av自拍| 天天综合日日夜夜精品| 亚洲免费电影在线| 日韩视频一区在线观看| 99精品国产热久久91蜜凸| 日本欧洲一区二区| 国产精品久久夜| 日韩亚洲欧美中文三级| av在线播放一区二区三区| 日本成人在线网站| 亚洲乱码中文字幕综合| 精品国产一区a| 欧美午夜精品久久久久久孕妇| 国产一区视频网站| 香港成人在线视频| 日韩伦理电影网| 久久久高清一区二区三区| 欧美色区777第一页| 波多野结衣中文字幕一区| 毛片av中文字幕一区二区| 亚洲色图色小说| 久久九九国产精品| 精品少妇一区二区三区日产乱码| 91女神在线视频| 国产成人高清视频| 国产一区三区三区| 日韩av不卡一区二区| 一区二区三区蜜桃网| 国产精品毛片久久久久久 | 欧美精品自拍偷拍动漫精品| 成人av电影观看| 国产美女精品在线| 久久国产剧场电影| 青青草97国产精品免费观看无弹窗版| 日韩理论片在线| 国产精品毛片大码女人| 国产免费成人在线视频| 国产日韩成人精品| 国产亚洲人成网站| 国产视频视频一区| 久久久久久久电影| 26uuu精品一区二区| 精品国产乱码久久久久久免费| 91麻豆精品久久久久蜜臀| 欧美日韩国产综合久久| 欧美日韩国产成人在线91| 欧美三级在线播放| 欧美伊人精品成人久久综合97 | 亚洲另类在线一区| 亚洲乱码精品一二三四区日韩在线| 中文字幕日韩一区| 亚洲人成小说网站色在线 | 欧美亚日韩国产aⅴ精品中极品| 99久久精品国产一区| 91精品国产综合久久精品app| 欧美日韩国产天堂| 欧美一区二区三区免费| 精品国产乱码91久久久久久网站| 精品国产乱码久久久久久蜜臀| 久久精品综合网| 亚洲欧洲精品一区二区三区| 有坂深雪av一区二区精品| 亚洲靠逼com| 日本不卡一区二区三区高清视频| 久久电影网站中文字幕| 国产精品一区二区三区网站| 成人中文字幕在线| 欧美性极品少妇| 日韩欧美国产成人一区二区| 久久综合99re88久久爱| 国产精品久久久久影院色老大| 亚洲黄色尤物视频| 免费看日韩精品| 波多野洁衣一区| 欧美日韩色综合| 久久久天堂av| 亚洲午夜电影网| 国产在线不卡一区| 91丨porny丨户外露出| 在线成人av影院| 国产日韩欧美精品一区| 一区二区高清在线| 久久99精品国产麻豆婷婷洗澡| 99国产精品久久久久| 91精品国产欧美一区二区18 | 亚洲精品亚洲人成人网在线播放| 午夜精品福利一区二区三区av| 国产综合久久久久久久久久久久| 北岛玲一区二区三区四区| 欧美伦理视频网站| 国产精品国产三级国产普通话三级| 亚洲高清在线精品| 成人一区二区三区视频| 51精品国自产在线| 亚洲欧美日韩人成在线播放| 久久99精品久久久久久动态图| 91麻豆精品视频| 国产亚洲一区二区在线观看| 亚洲国产精品一区二区久久恐怖片 | proumb性欧美在线观看| 日韩一区二区三区免费看| 亚洲天天做日日做天天谢日日欢| 久久av中文字幕片| 欧美天堂一区二区三区| 中文字幕制服丝袜一区二区三区| 秋霞电影网一区二区| 色综合久久久久综合99| 欧美国产日韩在线观看| 精品一区二区影视| 欧美老年两性高潮| 亚洲激情网站免费观看| 成人av动漫在线| 久久精品亚洲麻豆av一区二区 | 成人久久18免费网站麻豆 | 韩国欧美国产1区| 在线观看91精品国产麻豆| 亚洲婷婷国产精品电影人久久| 国产伦精品一区二区三区免费迷| 欧美放荡的少妇| 日韩精品欧美精品| 欧美二区三区的天堂| 天堂影院一区二区| 欧美丝袜丝nylons| 夜色激情一区二区| 2024国产精品| 久久av老司机精品网站导航| 欧美精三区欧美精三区| 亚洲午夜精品在线| 欧美三级日本三级少妇99| 亚洲成人综合在线| 欧美日韩三级一区二区| 天堂在线亚洲视频| 日韩一区二区三|