zyh.robot
Class Robot

java.lang.Object
  |
  +--zyh.robot.Robot

public class Robot
extends java.lang.Object
implements java.lang.Runnable

A robot can parse the content of a URL and extract all links, then parse those new URLs, recursively. If you are behind a firewall, please read also Let Java Applications Through Firewall


Constructor Summary
Robot(long requestInterval, URLManager urlManager, ThreadPool threadPool, java.net.InetAddress proxyInetAddress, int proxyPort)
          Creates a Robot object
 
Method Summary
 boolean isAlive()
           
 boolean isIdle()
           
 void run()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Robot

public Robot(long requestInterval,
             URLManager urlManager,
             ThreadPool threadPool,
             java.net.InetAddress proxyInetAddress,
             int proxyPort)
Creates a Robot object
Parameters:
requestInterval - Requests 1 document per n milliseconds Suggestion: Using 60000~300000 milliseconds to avoid the potential overload of the destination host Warning: Using a smaller value for requestInterval only when you're exploring your own website
urlManager - The URL manager which decides on the visit policy
threadPool - The thread pool manager which manages the thread distribution
proxyInetAddress - the InetAddress of HTTP proxy
proxyPort - the port of HTTP proxy
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isAlive

public final boolean isAlive()

isIdle

public final boolean isIdle()

stop

public void stop()

run

public void run()
Specified by:
run in interface java.lang.Runnable