bass.crawler
Class PageDistributon

java.lang.Object
  extended by bass.crawler.PageDistributon
Direct Known Subclasses:
ErrorPageDistribution

public class PageDistributon
extends java.lang.Object

Basic class for iterating from 0 to a max number on a centralized place

Version:
0.1
Author:
Thomas Klein

Field Summary
private  int arrayIndex
           
private  int current
           
protected  int pageCount
           
private  boolean[] pageStatus
           
private  long startTime
           
private  long waitTime
           
 
Constructor Summary
PageDistributon()
           
PageDistributon(int maxCount)
           
 
Method Summary
 int getCurrent()
           
 int getPage()
          returns current page count & increases count
 int getPageCount()
           
 void setPageCount(int maxCount)
          sets the maximum value returned
 void setStatus(int pageNumber, boolean pageStatus)
          Using a boolean array to save the pages we already crawled and the ones with errors to check them later again
 void writeMissingPages(java.lang.String country)
          writes the missing pages to a text file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageCount

protected int pageCount

current

private int current

arrayIndex

private int arrayIndex

pageStatus

private boolean[] pageStatus

startTime

private long startTime

waitTime

private long waitTime
Constructor Detail

PageDistributon

public PageDistributon(int maxCount)

PageDistributon

public PageDistributon()
Method Detail

setPageCount

public void setPageCount(int maxCount)
sets the maximum value returned

Parameters:
count - in our case the max page number

getPage

public int getPage()
returns current page count & increases count

Returns:
current page count, if max page count is reached -1 is returned

writeMissingPages

public void writeMissingPages(java.lang.String country)
writes the missing pages to a text file

Parameters:
country - current country (will be included in filename) filename = missing_pages_.txt

setStatus

public void setStatus(int pageNumber,
                      boolean pageStatus)
Using a boolean array to save the pages we already crawled and the ones with errors to check them later again

Parameters:
pageNumber -
pageStatus -

getCurrent

public int getCurrent()
Returns:
the current pagenum

getPageCount

public int getPageCount()
Returns:
the pageCount