spider.crawl
Class Frontier

java.lang.Object
  |
  +--spider.crawl.Frontier

public class Frontier
extends java.lang.Object

Author:
Gautam Pant The frontier (priority queue) implementation. The methods are synchronized in order to allow multi-threaded acces

Constructor Summary
Frontier(Cache c)
          if no size is specified, then set up a flag for unlimited frontier
Frontier(int max_size, Cache c)
           
 
Method Summary
 boolean addElements(java.util.Vector fes)
          Adds a set of elements to the frontier given a sorted list of urls (sorted by score) The function allows optimization of code when many URLs need to be added returns true unless Exception is caught - omitted for now
 FrontierElement getElement()
          get the top frontier element (according to priority) and delete it
 int getMaxSize()
          get max size
 int size()
          get current frontier size
 java.lang.String toString()
          a string version of the frontier's current state
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Frontier

public Frontier(int max_size,
                Cache c)

Frontier

public Frontier(Cache c)
if no size is specified, then set up a flag for unlimited frontier

Method Detail

addElements

public boolean addElements(java.util.Vector fes)
Adds a set of elements to the frontier given a sorted list of urls (sorted by score) The function allows optimization of code when many URLs need to be added returns true unless Exception is caught - omitted for now


getElement

public FrontierElement getElement()
get the top frontier element (according to priority) and delete it


size

public int size()
get current frontier size


getMaxSize

public int getMaxSize()
get max size


toString

public java.lang.String toString()
a string version of the frontier's current state

Overrides:
toString in class java.lang.Object