org.supermind.crawl
Class HostQueue

java.lang.Object
  extended by org.supermind.crawl.HostQueue

public class HostQueue
extends java.lang.Object

Queue of ScheduledURLs which belong to a particular host.


Constructor Summary
HostQueue(java.lang.String name, java.lang.String protocol)
          Ctor.
 
Method Summary
 void add(ScheduledURL scheduledURL)
           
 boolean contains(java.net.URL url)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
           
 long getNextAvailable()
           
 java.util.LinkedList<ScheduledURL> getPages()
           
 java.lang.String getProtocol()
           
 int hashCode()
           
 ScheduledURL[] pop()
          Pop ScheduledURLs for crawling.
 void setNextAvailable(long nextAvailable)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HostQueue

public HostQueue(java.lang.String name,
                 java.lang.String protocol)
Ctor.

Parameters:
name - Name of host
protocol - Protocol
Method Detail

add

public void add(ScheduledURL scheduledURL)

contains

public boolean contains(java.net.URL url)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()

getNextAvailable

public long getNextAvailable()

getPages

public java.util.LinkedList<ScheduledURL> getPages()

getProtocol

public java.lang.String getProtocol()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

pop

public ScheduledURL[] pop()
Pop ScheduledURLs for crawling. Number of ScheduledURLs popped is Fetcher.maxPagesPerConnection.

Returns:
ScheduledURL[] or null, if no more pages to fetch

setNextAvailable

public void setNextAvailable(long nextAvailable)

toString

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